you can use a guid for a temp id and return to the Ajax caller (encrypted if security is important). then rename the file when you have the correct. I'd add a static prefix, so you can identity images that were uploaded, but no form post was received.
Temporary ID
ANB
181
Reputation points
I have an application which contains a product form and inside of it, a section for image uploads.
When a person uploads a file, I make a POST via AJAX and the file should be saved in /myServer/productID/fileName
However I will just have the productID later when I submit the product form.
How can I do that ?
Thank you
Developer technologies | C#
11,578 questions
2 answers
Sort by: Most helpful
-
Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
2021-11-12T16:19:45.72+00:00 -
ANB 181 Reputation points
2021-11-12T17:37:33.517+00:00 This way I could rename the file on the database later when the product form is submitted.
However I still need a task to move the file from the temporary folder to the right one right ?