2

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

David Hoerster
  • 27,923
  • 8
  • 65
  • 100
Semas
  • 849
  • 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
  • 55,635
  • 14
  • 110
  • 143
Deepika
  • 384
  • 1
  • 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
  • 3,926
  • 2
  • 27
  • 35