2

is it possible to upload files to web page and then access file data on website using $_FILES['file'] in php?

David Hoerster
  • 28,421
  • 8
  • 67
  • 102
Semas
  • 869
  • 10
  • 22

2 Answers2

2

Use the following code to send file name to php file as POST value and it also stores the returned value

WebClient client = new WebClient();
byte[] bret = client.UploadFile(webpath, "POST", filepath);
string sret = System.Text.Encoding.ASCII.GetString(bret);
alexn
  • 57,867
  • 14
  • 111
  • 145
Deepika
  • 444
  • 3
  • 11
0

You have to modify your webserver in some way to answer POST requests with the appropriate actions. If you can't acces your server, you can't upload to it with C#; there is no 'standard' way to do this.

Jouke van der Maas
  • 4,117
  • 2
  • 28
  • 35