I'm just getting started developing DNN modules and I'm trying to write a module that takes a PDF and a JPG (as a thumbnail for the PDF) and then displays them as a list. I have everything working the way I want and have been able to get folders created and files uploaded but I can't actually associate the files with the database record.
I'm using the DnnFilePickerUploader which handles asynchronous file posting well but every time I actually pick the file I want and post the page back, I get "A critical error has occurred. Selection out of range Parameter name: value." It never even hits a breakpoint in my event so I'm assuming the error is coming on a Page_Load somewhere under the hood during the postback.
Documentation is essentially non-existent on this control so any help would be appreciated!
Ok, so I dug into the code for this control and figured out it's a bug that seems to be coming from the client. The FilePath that's passed to the server has an extra '/' between the folder and the file name so it comes through as something like 'myfolder/mysubfolder//myuploadedfile.ext' instead of 'myfolder/mysubfolder/myuploadedfile.ext'.
The underlying issue, however, is that I've come to realize this isn't how the file system is meant to be used in DNN. I was trying to get the path to the file and store that in my database but the intended use is to get (and store) the FileId from the control. DNN manages files with a database record and stores a lot of useful metadata for each file that can be accessed using the FileManager (and FolderManager) classes.