I want to know if there is a way to send files to a website with sm ESP 8266 or any other IoT device. I intend that the IoT device will be the client. A PHP or scripting file on the website will act as the server. It will look like the IoT device is uploading the files to the website.
Typically, files are uploaded using a HTTP POST from a web form (I assume that's what you're thinking of when you say file upload). The exact format of the request tends to look a bit like this, as defined in RFC 1867.
The user 'gbafamily1' from the ESP8266 forums has created an example that POSTs a 256 byte file,
posttestserver.com. It should be relatively easy to adapt this to your needs, and I'd expect to use something like this on the server-side HTML:
<form action="posttestserver.com" method="post" enctype="multipart/form-data"> <label for="file">Upload File:</label> <input type="file" name="testfile" /> <input type="submit" /> </form>
Then, you could implement the server side in PHP to accept the file being uploaded. There is a reference available in the PHP documentation, and files sent by POST are stored in
With this example, the code above would allow browsers to upload, and the code provided by the ESP8266 forums would allow you to upload from the IoT device.