Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 444077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:14:04+00:00 2026-05-12T21:14:04+00:00

is this possible ? what is the correct way to send files ? thanks

  • 0

is this possible ?
what is the correct way to send files ?

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T21:14:04+00:00Added an answer on May 12, 2026 at 9:14 pm

    I don’t if you want your webservice to upload/download files. Anyway you can use curl(http://fr.php.net/curl ) to upload/download file from other webserver.

    To get some file uploaded to the webservice from the user it’s pretty much the same as gettings it from a form, please use the superglobal variable:$_FILES (doc) to get upload files.

    for uploading from php to a webservice

    $fullflepath = 'C:\temp\test.jpg';
    $upload_url = 'http://www.example.com/uploadtarget.php';
    $params = array(
     'photo'=>"@$fullfilepath",
     'title'=>$title
    );  
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL, $upload_url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
    $response = curl_exec($ch);
    curl_close($ch);
    

    the webservice to get a file

    $uploads_dir = '/uploads';
    foreach ($_FILES["photo"]["error"] as $key => $error) {
        if ($error == UPLOAD_ERR_OK) {
            $tmp_name = $_FILES["photo"]["tmp_name"][$key];
            $name = $_FILES["photo"]["name"][$key];
            move_uploaded_file($tmp_name, "$uploads_dir/$name");
        }
    }
    

    PS: sorry for some reason stackoverflow doesn’t like to make a link of $_FILES … so I have linked the superglobals page instead

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is probably possible using Streams, but I wasn't sure the correct
Is this possible to do? I want to ping or send some kind of
Ok, I think its possible I've misunderstood the correct way to implement an external
Possible Duplicate: How to request a random row in SQL? Is this the correct
Using the OWASP checklist, which is the correct way protect this situation? This is
Possible Duplicate: Correct way to escape input data before passing to ODBC the error
Is this possible to use Ajax.Beginform with update target inside of ajax form. like
Is this possible if I click on an anchor link to simulate as if
Is this possible? My code works on Firefox. I can also get webkit to
Is this possible? function testObj(testArg) { //Do obj stuff here } testObj.prototype.addFn = function()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.