How to prevents users from dragging and dropping files from a compressed zip folder in upload control

1 Answer 45 Views
AsyncUpload
Afroz khan
Top achievements
Rank 1
Afroz khan asked on 17 Dec 2024, 05:49 PM
How to prevents users from dragging and dropping files from a compressed zip folder in upload control

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Aug 2025, 11:28 AM

Hi Afroz,

RadAsyncUpload does not provide a built-in way to detect or block files that are dragged and dropped from inside a compressed ZIP folder. When a user drags a file out of a ZIP archive and drops it onto the upload area, the browser treats it as a regular file, so there is no metadata or property available to determine its origin.

Current Options and Limitations:

  • Blocking ZIP Files:
    You can block users from uploading ZIP files themselves by validating file extensions (e.g., ".zip"). However, this does not prevent users from extracting files from a ZIP and then uploading them.

  • Detecting ZIP-Origin Files:
    There is no browser API or client-side JavaScript method to determine if a dropped file was originally inside a ZIP archive. All files, regardless of their source, are seen as regular files by the upload control.

  • Client-Side Validation:
    You can use the OnClientFileDropped event to inspect file properties (such as name or type) and implement custom rules, but you cannot detect ZIP-origin files this way.

Alternative Approaches:

  • Server-Side Validation:
    If there are specific file types or content you want to block, consider adding server-side validation after upload to inspect file signatures or contents.

  • Disabling Drag and Drop:
    If drag and drop is not required, you can disable this functionality in RadAsyncUpload to force users to use the file picker dialog, which might help control the user experience:

Related Feedback:

Summary:

  • It is not technically possible to prevent users from dragging and dropping files that were extracted from a ZIP folder, as browsers do not expose this information.
  • You can block ZIP files by extension or disable drag-and-drop if that helps your scenario.

 

    Regards,
    Rumen
    Progress Telerik

    Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
    Tags
    AsyncUpload
    Asked by
    Afroz khan
    Top achievements
    Rank 1
    Answers by
    Rumen
    Telerik team
    Share this question
    or