Upload retry dialog doesn't show when uploading a file that already exists

Hello,

When trying to upload a file that already exists in a folder, i am expecting an upload retry dialog to appear that gives the option to either rename or replace the existing file like it shows in the demo. however the upload failure dialog shows up instead even though the api is returing 400 File already exists.

Image_2803_1710855901147

Image_1497_1710855843677


5 Replies

JA Jafar Ali Shahulhameed Syncfusion Team March 20, 2024 01:06 PM UTC

Hi Mariam,


Based on the shared details we can understand that you are trying to utilize Syncfusion File Manager component. We regret to inform you that we do not have support for renaming the file during the duplicate file upload. Also, we would like to inform you that according to the current implementation of the File Manager component while trying to upload the duplicate file the popup shown in the below screenshot appears,


 


When clicking the “Keep Both” button the duplicate file being uploaded is automatically renamed with suffix (1). Clearly, while trying to upload the duplicate file named John and clicking the “Keep both” option will rename the currently uploaded file John as John(1).


On clicking “Replace” already existing file with same name is get replaced with the currently uploaded file. And for “Skip” button simply skip the duplicate file upload.


However, we have prepared the sample where you can check the above mentioned functionality,


We have attached the sample and service for your reference,


Sample: https://stackblitz.com/edit/angular-njpjwg-g3jtue?file=src%2Fapp.component.ts


Service: Attached as zip file


File provider: https://ej2.syncfusion.com/documentation/file-manager/file-system-provider#aspnet-core-file-system-provider


It is important to note that you have to run the service sample to work on the shared File Manager sample. After running the project, it will be hosted in http://localhost:{port} and just mapping the ajaxSettings property of the FileManager component to the appropriate controller methods allows to manage the files in the file provider. We have made this necessary changes in the attached sample itself.


Kindly check out the shared details and get back to us if you need further assistance.


Regards,

Jafar


Attachment: FileProviderSample_dc86e0d4.zip


MR MARIAM RAMDI March 20, 2024 03:11 PM UTC

Hello,

Thank you for your response regarding my inquiry about the Syncfusion File Manager component.

I appreciate the information provided regarding the behavior of the duplicate file upload popup. However, it seems that the popup you mentioned in the screenshot is not appearing in my case. Despite attempting to upload duplicate files, I do not encounter the option to "Keep Both", "Replace", or "Skip" as described.

Could you please provide further guidance on how to enable or troubleshoot this feature? It appears that the functionality is not working as expected in my implementation.

Looking forward to your assistance.

Image_7057_1710943880676

Best regards,

Mariam.



JA Jafar Ali Shahulhameed Syncfusion Team March 21, 2024 06:47 AM UTC

Hi Mariam,


We can understand that you are facing a popup issue in the File Manager component. We have tried to replicate the issue in the previously provided sample and we regret to inform you that we cannot be able to replicate the issue from our end.


We suspect that there might some issue with your upload url in your sample also we need to clarify that whether you are getting this upload failure popup during a normal upload or only in the duplicate file upload.


We Kindly suggest you to provide some additional details regarding the issue you are facing such as the provider you are using, any changes in the ajax settings, issue replicating sample or try to replicate the issue in the shared sample this will help us to provide you a prompt solution.


We have attached the sample for your reference,


Sample: https://stackblitz.com/edit/angular-njpjwg-x4ranf?file=src%2Fapp.component.html,src%2Fapp.component.ts


Kindly check out the shared details and get back to us if you need further assistance.


Regards,

Jafar



MR MARIAM RAMDI March 21, 2024 09:07 AM UTC

Hi Jafar,


Thank you for your response and for looking into the issue.


Regarding the problem with the upload retry dialog not showing up, I can confirm that it occurs specifically during duplicate file uploads. When a file with the same name already exists in the target location and a user attempts to upload a file with the same name, instead of displaying the expected dialog for retrying the upload, the behavior seems to bypass this step entirely.


In terms of the backend response, here's what we're receiving:

Response returned in inside upload function in PhysicalFileProvider
Image_9805_1711007934360


Reformulation inside File Manager Controller (Upload end point)

Image_7182_1711008036970

And for clarity, here's the response received in the frontend:

Image_9385_1711008228855

Image_6818_1711008350059


We hope this additional information helps in identifying the root cause of the issue. If there are any specific details or logs you require from our end, please let us know, and we'll provide them promptly.


Looking forward to your further assistance in resolving this matter.


Best regards,

Mariam





JA Jafar Ali Shahulhameed Syncfusion Team March 22, 2024 10:59 AM UTC

Hi Mariam,


We can understand that you are still facing an issue while duplicate file upload and we regret to inform you again that we cannot be able to replicate the issue from our end.


Also, on checking your shared screenshots we suspect that the issue you are facing might be due to the Cors policy issue. We kindly suggest you to install the Cors extension in your browser and enable it to resolve the issue.


Kindly refer the below links to resolve your issue,


https://www.syncfusion.com/forums/162418/cors-error


https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSAllowOriginNotMatchingOrigin


https://daveceddia.com/access-control-allow-origin-cors-errors-in-angular/


If you are still facing an issue while duplicate file upload, We kindly suggest you to provide some additional details as already requested. Such as your code details, customization you have made in upload url, video footage with clear replication procedure, issue replicating sample or try to replicate the issue in the previously shared sample this will help us to provide you a prompt solution.


Kindly check out the shared details and get back to us if you need further assistance.


Regards,

Jafar


Loader.
Up arrow icon