0

I really hate asking questions like this... but could someone point me to some examples of how to upload a file in a custom DNN 9 SPA module? I have been looking and have not been able to find anything.

Thank you in advance

VDWWD
  • 35,079
  • 22
  • 62
  • 79
John Kane
  • 4,383
  • 1
  • 24
  • 42

2 Answers2

0

You can use the build-in DnnFilePicker

<%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web" Namespace="DotNetNuke.Web.UI.WebControls" %>

<dnn:DnnFilePicker runat="server" ShowFolders="false" ID="fpUserFiles" FileFilter="pdf,gif,jpg" />
VDWWD
  • 35,079
  • 22
  • 62
  • 79
  • But since it's a SPA it means the module will be .html and not ascx, thus it won't run on the server and the server control won't be of any use. Any ideas how to get this sorted? – alwaysVBNET Oct 23 '18 at 17:49
  • @alwaysVBNET a normal input type=file perhaps? You could still store files outside the DNN file sytem. – VDWWD Oct 23 '18 at 19:45
0

You can really use any client-side file upload (e.g., DropZone, jQuery Upload, standard HTML 5 upload, etc.) and then use a DNN Web API endpoint to perform the server-side saving of the file.

David Poindexter
  • 488
  • 4
  • 12