Default folder and filename for html file upload

2019-07-01 14:14发布

问题:

I'm using a jQuery Ajax plugin to upload image files from a local machine to a webserver. The webpage presents a button marked Upload Image File, the user presses the button and selects the file to upload from a popup directory listing presented by the browser, PHP at the server stores the image file away, and all that works fine.

When the user views the webpage to upload the image, the file path of the image on the local computer is completely predictable. This is part of a workflow where the file names and folders are well-defined.

I understand that the file upload mechanism in the browser is deliberately not changeable, because that would be a security worry. But, is it possible to give it a hint, so it presents the popup directory listing with the correct file in the correct folder already selected, so the user just has to hit return to confirm the upload?

I looked at Set a default file name/directory for upload on web form by modifying the html but found nothing I could use. Is this hinting impossible?