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?
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 };
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:
Awesome! Simply post in the forums using the link below and we'll get you started.