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 8066063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:51:40+00:00 2026-06-05T11:51:40+00:00

I want to upload file with C# client app and Nusoap webservice. How i

  • 0

I want to upload file with C# client app and Nusoap webservice. How i can do this? I use Nusoap webservice for insert in database but for upload files i don’t have any idea. Please help me.
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-06-05T11:51:42+00:00Added an answer on June 5, 2026 at 11:51 am

    As I haven’t any experience with NuSOAP, I shall answer with the best of my knowledge of uploading a file to a server running PHP, without using NuSOAP.

    The following code will POST the contents of a given file to a PHP page, as if it was sent via a standard HTML form.

    public void UploadFile(string path) {
        WebClient wc = new WebClient();
        wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
        Int64 numBytes = new FileInfo(path).Length;
        FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
        BinaryReader br = new BinaryReader(fs);
        Byte[] data = br.ReadBytes(Convert.ToInt32(numBytes));
        br.Close();
        fs.Close();
        wc.UploadData("http://127.0.0.1/upload.php", "POST", data);
    }
    

    Edit: Here is the PHP that I used for this a while ago. It is potentially insecure and will always overwrite the same file every time a new one is being uploaded. You could try to work some dynamic-ness into this, along with some file checks for security sake… but you should also be able to use a modified PHP file intended for standard uploads (from a web form).

    <?php
        $fp = fopen('snap.jpg', 'wb');
        fwrite($fp, file_get_contents('php://input'));
        fclose($fp);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

use C#,want to upload excel file on google doc. bellow syntax use to upload
I want to upload an image file into mysql database on Android Mobile Programming,
I want to read a client side XML file uploaded via upload file dialog.
I want to upload a file securely from client machine to a webserver using
Want to upload a file using ajax for this using this uploader http://valums.com/ajax-upload/ and
so actually i'm writing client/server programs using TCP/IP. In this case, client can upload
I want to upload files from a client location to a server. At present,
I am developing an web application which can upload/download a file from client to
I want to upload a file using GWT to REST web service. But I
I want to upload file to a host by using WebClient class. I also

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.