Pranav Kumar
Pranav Kumar

Reputation: 259

Unable to upload files by drag-drop with multiple instances of user control in a web page(ASPX page)

<div id="divDropZone">
   <p>
        Drag and drop an Image to Upload
   </p>
   <p>
        <button id="btnInsertButton">Or Select Image to Upload</button>
   </p>
   </div>
   <CuteWebUI:Uploader runat="server" ManualStartUpload="false" ID="UploaderFile"
      InsertButtonID="btnInsertButton" DropZoneID="divDropZone" OnFileUploaded="Uploader_FileUploaded">
      <ValidateOption AllowedFileExtensions=".png,.jpg,.bmp,.jpeg,.gif" MaxSizeKB="10240" />

Above is the code that renders the dropzode wherein user can drag & drop files to upload it.

Here is the description of the 3rd party DLL, dev framework used and the browser description:

Here are the steps to reproduce the problem:

  1. Created an web page(ASPX page) in .NET Framework 4.5.

  2. Created a user control and added its reference to the web page created in step #1.

  3. Added reference of "CuteWebUI.AjaxUploader.dll" and the path of licence file in web.config.

  4. Implemented the above code in user control that is created in step #2.

  5. Added 2 instances of user control created in step #2 i.e. one in ResumeUpload section and another one in Bootstrap Popup.

  6. When we use only one instance of user-control instead of 2 (that we need to avoid repetition of code), it works as expected.

  7. But when we add 2 instances of user control, it throws the following exception while dragging and dropping the file in dropzone: "Server side exception, failed to upload Sample.pdf Debug information: System.Exception: X1 GUID Error\ x0D\ x0A at CuteWebUI.UploadModule.a(@HttpContext A_0, GUID A_1)

NOTE: We tried with the following but it didn't work for us:

<ValidateOption EnableMimetypeChecking="false" />

Upvotes: 1

Views: 408

Answers (1)

Doug
Doug

Reputation: 1

Check the user controls DropZoneID property. If multiple controls have the same drop zone, files dropped will cause the upload in each control. This seems to cause this GUID Error exception. Having a separate drop zone for each control will solve the problem.

Upvotes: 0

Related Questions