Is it possible to upload specific files from users PC to server, but WITHOUT using file form element?
I need this for my customer - he does not want to select those files from his pc.
Is it possible somehow to define value of file form element like we can for other elements?
Thank you in advance, hope that this question is not basic one.
MORE INFORMATION: we know that we can upload file on server, using 'file' web form element. By using this element we select file from our computer and upload it on server. Ok, but is possible to "skip" file selection, and upload specific file (files) without selecting it with file form element?
Not without some help from an external plugin. The browser has the file element locked down because it would be a security risk to allow any website to automatically upload a file from your computer.
EDIT: Now that I see what you want to accomplish, why go through the browser? Why not setup some sort of synchronization between his computer in the server that doesn't go through the web?
The file should be selected in order to be encrypted, the encryption consists of it's data, so for security reasons browsers doesn't allow default values not to have file injections, so the answer is no, you still need to use <input type="file">
with no default value, read this for more info.
I think your best bet would be to use a signed java applet. End user will be prompted to grant certain permissions (local file access, network access) when the applet is launched for the first time but it's possible to suppress permission requests on subsequent launches by having user check the "trust the publisher" checkbox.
Use the name
attribute in the input
element, and tell the customer use a suitable version of Opera that supports the attribute. Something like Opera 7. Might be hard to find.
I know that this answer may sound sarcastic, but this hopefully illustrates the situation: file input was originally designed to allow a default filename to be specified, this was implemented in some browsers only for some period of time, and now the excuse is “security”, i.e. browser vendors did not want to implement suitable security precautions and they describe the issue as if the idea itself were “insecure.”