version 2016.2
Using the igUpload control, is it possible to move the file to another folder after the upload is completed under .NET core?Is there a way to tie in to a server side event related to the "controlId" within the controller?
Hello Stephen,
Thank you for posting in our community.
igUpload control allows you to manipulate(delete, move, copy etc.) uploaded files. This can be achieved by handling UploadFinishing server side event. In this event the file is uploaded in a temporary folder (set in the web.config file) where all files are saved while uploading. Initally the file has a unique name (that is generated from Upload HttpModule) which is afterwards changed to files original name (if there is a file with a duplicate name it will be overwritten). To achieve your requirement you can cancel this event and move the file to the folder of your choice. Some further reference about using server side events of igUpload can be found online:
https://www.igniteui.com/help/igupload-using-server-side-events
In regards to your second question I will need some additional information. By design when registering an event in the Global.asax file, you add the control`s id as a parameter which means that this particular handler is tightly coupled with a particular controls event. For example if you have the following code in the Global.asax:
UploadProgressManager.Instance.AddFileUploadingEventHandler("upload1", new EventHandler<FileUploadingEventArgs>(Controllers.HomeController.igUpload_FileUploading));
This will mean that igUpload_FileUploading event is going to be triggered only for "upload1" control.
Please let me know if you need any further assistance with this matter.
For asp.net 6 (core) there is no global.asax
All the configuration form former global.asax file goes into new root Startup.cs file. Some further information about this change can be found at the following links:
https://docs.microsoft.com/en-us/aspnet/core/migration/configuration
https://wildermuth.com/2015/3/2/A_Look_at_ASP_NET_5_Part_2_-_Startup