Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
Single or multiple UploadHandlers, Stream and noStream controls
posted

Hi,
I work on C#, .NET 4.5 with Ignite UI 2012.3.
Here is the problem : I have some pages on which the user uploads large files or packets of files - 10-500 MB and some pages on which the user uploads 'logo.png' or some other small files. Thus I have used your implementation in the documentation as basis (Saving Files as Memory Stream by Processing Each Uploaded Chunk of the File Individually) for the page with the large files so I can directly save them to Azure Blob or Local Disk.

It works fine. But this is done also by adding '<add key="FileSaveType" value="memorystream" />' to web.config which rendered unusable my other basic upload controls on other pages. Those I used without registering a handler. ( Have I configured something wrong? )

There is only one option before me and I ask for confirmation and suggestion for best practice : I must register handlers for every control using stream mode. This is not a problem. But I want to know if I can reuse the handlers because I see that the FileUploadingEventArgs e.TemporaryFileName is randomly generated so uploaded files will not step on each others toes.

What is best in this situation? Can I reuse the upload handler methods and register all controls ( by their controlId ) with the same upload handler or I have to make separate instance of the handler methods for every registration? Is there a way to use streamed and not streamed controls in the same project?

If I can reuse the upload handling methods ( FileUploading, FinishingUpload and FinishedUpload ) it will be best.

Parents
No Data
Reply
  • 23953
    Verified Answer
    Offline posted

    Hello Hristo,

    hristo_guentchev said:
    It works fine. But this is done also by adding '<add key="FileSaveType" value="memorystream" />' to web.config which rendered unusable my other basic upload controls on other pages. Those I used without registering a handler. ( Have I configured something wrong? )

    FileSaveType option is application wide, thus you should stick with saving the files as memory stream for all of your igUpload/WebUpload instances. This is architectural limitation of the control, because it uses one Http Handler and on Http Module for processing the files from all of the control instances. 

    hristo_guentchev said:
    There is only one option before me and I ask for confirmation and suggestion for best practice : I must register handlers for every control using stream mode. This is not a problem. But I want to know if I can reuse the handlers because I see that the FileUploadingEventArgs e.TemporaryFileName is randomly generated so uploaded files will not step on each others toes.

    Yes, you should register handlers for all of the control instances. 

    hristo_guentchev said:
    What is best in this situation? Can I reuse the upload handler methods and register all controls ( by their controlId ) with the same upload handler or I have to make separate instance of the handler methods for every registration? Is there a way to use streamed and not streamed controls in the same project?

    Yes, you can reuse the handlers. As shown in the Saving Files as Stream (igUpload) topic you should create a static handlers and register them for all of the igUpload/WebUpload controls in the Application_Start method of the Global.asax file.

    Hope this helps,
    Martin Pavlov
    Infragistics, Inc. 

Children