How JFileUpload could rename duplicated files before upload ?
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.