DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Integrating Dropzone - Reference Issue

Sort:
You are not authorized to post a reply.





New Around Here





    Hey!

    I'm trying to set up Dropzone file upload on my DNN 9.4.4 site - Hotcakes 3.2.3 is installed as a module as well.
    In order to handle the files on the server side, I used the latest DNN template by Chris (https://github.com/ChrisHammond/DNNTemplates) to create a C# DAL2 MVC Module and followed his instruction videos https://www.youtube.com/w...wIbNZFd&index=11
    Since the target framework in DNN 9.4.4 is .NET 4.7.2 I changed it on the template as well.

    After that, I added my Controller, compiled it and installed it as an extension. However, when calling my action url: '/DesktopModules/MVC/DropzoneHandler/Dropzone/Upload' I just receive an assembly reference error:
    Server Error in '/desktopmodules/mvc/DropzoneHandler' Application.
    Could not load file or assembly 'Hotcakes.Commerce.Dnn' or one of its dependencies. The system cannot find the file specified.

    There's no reference to Hotcakes assemblies anywhere in that project, nevertheless some subassembly is looking for various Hotcakes.dlls within /DesktopModules/MVC/DropzoneHandler/bin - they are located in the root/bin folder and if I copy them over, it's working.

    I tried to figure out what's calling those DLLs using the Fusion log, that didn't work. Via Process Monitor I found out where it's looking for the DLLs.

    Does anyone have an idea how to solve this issue?


    Regards,
    Alois Krichmayr
    www.sierzega.com





    New Around Here





      Controller:

      using System.Web.Mvc;
      using System.IO;
      using DotNetNuke.Web.Mvc.Framework.Controllers;
      using DotNetNuke.Web.Mvc.Framework.ActionFilters;

      namespace Wiremayr.Modules.DropzoneHandler.Controllers
      {
          [DnnHandleError]
          public class DropzoneController : DnnController
          {

              public JsonResult Upload(int itemId)
              {
                  string imageUrl = string.Empty;
                  string imgPath = Server.MapPath("~/Uploads/");
                  if (!Directory.Exists(imgPath))
                  {
                      Directory.CreateDirectory(imgPath);
                  }

                  foreach (string s in Request.Files)
                  {
                      var file = Request.Files[s];
                      if (file.ContentLength > 0)
                      {
                          string fileName = Path.GetFileName(file.FileName);
                          var path = Path.Combine(imgPath, fileName);
                          file.SaveAs(path);
                          imageUrl = string.Format("~/Uploads/{0}", fileName);
                      }
                  }

                  return Json(new { img = imageUrl, thumb = imageUrl });
              }
          }
      }




      Dropzone:
      Dropzone.options.wmUpload = {
              paramName: "file",
              parallelUploads: 3,
              url: '/DesktopModules/MVC/DropzoneHandler/Dropzone/Upload',
              autoProcessQueue: true,
              addRemoveLinks: true
          };


      Regards,
      Alois Krichmayr
      www.sierzega.com





      Advanced Member





        Notice that in the error message it indicates the error is "in '/desktopmodules/mvc/DropzoneHandler' Application", meaning that a separate application was created that's not the root application. Look in IIS for a new application or virtual directory setup in the path and then delete it. Visual Studio will "helpfully" do this for you sometimes when setting up projects.
        DNN partner specializing in custom, enterprise DNN development https://engagesoftware.com/showcase
        You are not authorized to post a reply.

        These Forums are dedicated to the discussion of DNN Platform.

        For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

        1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
        2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
        3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
        4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
        5. No Flaming or Trolling.
        6. No Profanity, Racism, or Prejudice.
        7. Site Moderators have the final word on approving / removing a thread or post or comment.
        8. English language posting only, please.

        Would you like to help us?

        Awesome! Simply post in the forums using the link below and we'll get you started.

        Get Involved