Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How JFileUpload could rename duplicated files before upload ?

0
Posted

How JFileUpload could rename duplicated files before upload ?

0

JFileUpload can check if file already exists on server before uploading it. Use overwrite parameter to enable this feature. JFileUpload sends an additional request to server to know if current upload should be overwritten or not. If you’re interested in knowing how it works then see details below for HTTP : 1 – Applet sends HEAD request with “filename” header for current upload. 2 – Server script must return “HTTP 404 not found” response if file does not exist or “HTTP 200 OK” response with file size in a “size” header if file exists. 3 – Applet applies overwrite policy (indexrename, …) and loops to step 1 until making sure that the file to upload doesn’t exist on server. 4 – Applet sends HTTP multipart POST request to upload file with the new name. 5 – Server script handles upload request and save file.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123