Submitted by abitowhit on Mon, 01/07/2019 - 06:41
Concept
There are times when you are using a non-gui interface but would still like to be able to upload files which you can use later without requiring a browser to do so. Curl is a handy pi application which allows this type of html post interaction (and all kinds of other web things).
Resources
w3schools
Medium.com
Curl Command:
(Change pcd to match your secret key)
curl 'pcd=secretuploadkey' -F 'fileToUpload=@./webcheck.png' localhost/uload.php
Note: you do not need the html form to process curl, it is going directly to the php page.
You will need to insure your upload directory has permissions for writing.
You can change the types of files allowed in the file association area.
A Simple HTML Form
A Simple PHP Script
The script will append a stamp if the file already exists.