Can I store file path and not upload immediatly after click submit but upload it another page
I want to upload file with have only file path in php. Can anyone guide me how can I do. Now, I am developing a we开发者_C百科bpage that allow the user to upload file but when they submit we do not upload the files immediatly we keep files path and process uploading in another page. Please guide me how can I do, or I have to change my way to do it. Thank in advance.
If i understand you right you want to get a filepath, save that filepath and upload from that path later.
I'm sorry to say..this is not possible in the environment you described. The only way a file can be uploaded is the browser input element for file upload. For security reasons you cannot just upload a file from a filepath you know on the clients computer. So the user must do this all the way hisself.
Possibles solutions would be a signed java applet for example. But you can't do this the way you described. Maybe you could check on the web for possibilities to "upload multiple files at a time". The solutions for that problem could possibly help you getting further with yours.
No, that is not possible, for technical/security reasons: there is no way to set the file to be uploaded, except by user interacting with the upload box (because otherwise a malicious page could grab any file of the user).
What you could do is have the file upload as a separate form in an iframe (e.g. this is a useful JavaScript wrapper for that), upload the file first, and keep a reference to the file you now have on your server until the point when you actually need it in the main form.
精彩评论