Currently I'm using a simple numbering scheme invoice I know that I could use hashes instead to obscure the data. Is it also possible to use PHP and serve the invoices by not directly having the user point to them? Declare a variable and store the directory name where the downloaded file will save. Use the basename function to return the file basename if the file path is provided as a parameter.
Save the file to the given location. Open the saved file location in write string mode. Set the option for cURL transfer. Close the file. Skip to content. Change Language. Do you checked the file size for the downloaded file? Tip: Open the file in your text editor, most of the time you can see an error message. Solve the the reported problem. Otherwise check also your PHP error log. Thanks for the reply. But PDF, image file, txt file will download correctly for same code.
I create a seperate controller for only download action. So i find that it occur because of some other code affecting file. The bad thing is that headers work different for different server configurations. Hi Serge, you need to use the right headers. Check the example code for the PDF file. How to use this with.
Your email address will not be published. Notify me of followup comments via e-mail. Just drop it into your folder containing the uploaded files and run it.
Then you should be able to figure out what is going on. Yeah, but then there are around such directories where each directory will have around some files. How do I solve that problem? To put this file with different file name inside each directory? Any shortcuts? Let me give this a shot meanwhile and figure out the mechanism. Thank you. Edit: Just checked it out. Works like a charm.
But I put this along with my directory which has index. So it shows all the folders and files.
0コメント