is it possible to upload files to web page and then access file data on website using $_FILES['file'] in php?
Asked
Active
Viewed 980 times
2
-
Yes, see http://stackoverflow.com/questions/1131425/send-a-file-via-http-post-with-c. – Chris O Jul 24 '10 at 18:25
-
4Why is this titled and tagged as C# but you're looking to access the files via PHP? – David Hoerster Jul 25 '10 at 00:21
2 Answers
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);
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