PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
What im doing is, using the batch to create file...then Uploading it one the server through POST form so the file can be stored and editted with the information i need. Ive Got it working till here, it uploads and edits the file perfectly But what i want to do next is that as the POST DATA is sent and processed i want to Download the UPDATED file back on my PC using the ID of file Generated on the same page.
TO achieve this i added a redirect link the the download page at the end of DOUPLOAD.php i added this line:
But curl doesnt automatically download the file. Is there anyway to make it download from the Redirect Link at the end of php file after sending the POST Data/File ? Im trying to Download of the same page (DOUPLOAD.php) as it includes the ID generated for the upoaded file. (if thr is any other way to send the Unique Id generated by doupload.php to the batch thn please let me know)
I'm lazy and didn't feel like deciphering your entire post, but make sure that nothing is being sent to the browser, including whitespace but excluding other headers, before the header() line. Always use fully qualified URLs in Location headers; for this, stick http:// in front of "localhost".
But this saves the file with the name of doupload.php. I tried adding "filename.txt" infont of -O but thn it will give this error and it will print the whole file on screen rather thn saving:
but this ^^ saves the file with the name of dupload.php (which is the name of page we have the redirect link on). If i use -O "filenameiwant.txt" it will give the error i wrote in my last post.
I can add Rename at the end, which works fine. Just want to know if it can be saved with the name i want rather thn renaming it once its saved.