I am working on a batch-script that makes a SQL query and saves it to a file. The file will then be handled by PHP. Is it possible to POST a file from Windows CMD to a PHP site so it can be handled by php with $_FILES['someFile']
?
Asked
Active
Viewed 949 times
0
-
1This question should be asked on [Software Recommendations SE](http://softwarerecs.stackexchange.com/) or [SuperUser](http://www.superuser.com) + there are already plenty of questions asking for the same: [How to download files from command line in Windows, like Wget is doing?](http://superuser.com/questions/25538/how-to-download-files-from-command-line-in-windows-like-wget-is-doing), [POST binary file with cmd line curl using headers contained in the file](http://stackoverflow.com/questions/4053937/post-binary-file-with-cmd-line-curl-using-headers-contained-in-the-file) – Daniel W. May 12 '16 at 10:38
2 Answers
3
Yes, you can use curl for this.
curl -F someFile=@localfile.sql http://example.org/upload

Xyz
- 5,955
- 5
- 40
- 58
-
Great! can you make it open the site in a browser instead og inside cmd? – XerXeX May 12 '16 at 11:13
-