<FONT face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=2><div><font color="#990099">-----kwlug-disc-bounces@kwlug.org wrote: -----<br></font>>I've got a web based php script I run on my webserver. It accepts,<br>>via a standard input form, a few variables and an input file. Then it <br>>crunches some numbers and sends the results as a file via email. I<br>>have a number of files I want to parse through this script and I want to<br>>do it locally. How do I effectively POST a file (I could probably<br>>change the script to accept GET as well, though I expect it doesn't make a <br>>difference) via a line in a shell script? I know how to do it with<br>>the other variables, I just do this:<br>><br>>http://192.168.0.1/myscript.php?var1=val1&var2=val2<br>><br>>I want to repeat that numerous times as a shell script, with the file<br>>>upload attached somehow.<br>><br>>Help? :) I don't even know what to Google.<br><br>Files uploads are POSTed because of their size and the limitations on size that GET will accept. Perhaps curl could do that too.<br><br>Essentially you want to create a multipart form-data request that includes a file upload.<br><br>I've never had to do this before, but I bet there is a perl module that allows you to do this. Or I bet a PHP script could. You would have to build a stub PHP script that runs locally and accepts the vars and a file name via command line and creates the neccesary POST data.<br><br>My google fu lead to "php multipart post upload" and found:<br><br>http://curl.haxx.se/mail/curlphp-2008-11/0050.html<br><br><br><br></div></FONT>