locked
Creating Custom control like File upload control in asp.net RRS feed

  • Question

  • User775232658 posted
    I need to create custom control which will work exactly like file upload control that comes with ASP.net using .net. i need some suggestion on how to do it.. Thanks
    Tuesday, August 12, 2008 9:01 AM

Answers

  • User541108374 posted

    Hi,

      Are they using another method such as backtround transfer or something.
     

    Yes, they must do it differently. A way would probably be to post it to a custom httphandler that can handle a large stream in chunks and concatenate file snippets together while receiving another chunk of uploaded data. Also a way would be to expose a service that can handle it in such a way. Not always but mostly you see such controls render something like an activex control or java applet. You'll also going to be seeing silverlight upload controls too. You can already use these for multi uploading (http://www.nikhilk.net/Entry.aspx?id=169).

    Grz, Kris.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, August 17, 2008 3:26 AM

All replies

  • User541108374 posted

    Hi,

    first of all, what's wrong with the default fileupload control? What do you want to see changed about it?

    Grz, Kris.

    Tuesday, August 12, 2008 9:35 AM
  • User-16411453 posted

     I don't think you will get the anwser here on this website.

    I would like to as well, to deal with files over 20 megs, but I think it has to be written in C 

    Tuesday, August 12, 2008 7:18 PM
  • User541108374 posted

    deal with files over 20 megs

    That's easily solved by settings in the web.config. Take a look at this article: Dealing with the maximum upload size of ASP.NET.

    Grz, Kris.

    Wednesday, August 13, 2008 2:13 AM
  • User-16411453 posted

    I'm pretty sure the default is 4 megs, but you can alter the web config for up to 20 megs.

    I think it has something to do with the way the control is written, in which it uses server memory to store the upload until it release the stream into a write onto the disk drive and flushes the server memory.

    I've seen 3rd party controls that go up to 4 gigs, the must do a partial write to a temp file every couple of megs until it's done.

     

    Wednesday, August 13, 2008 3:01 PM
  • User1186257875 posted

    think it has something to do with the way the control is written

    Im quite sure it isnt!  I think its due to the maximum HTTP post size!

    Wednesday, August 13, 2008 4:38 PM
  • User541108374 posted

    I think its due to the maximum HTTP post size

    The default maximum form size (thus all controls included) is 4Mb.

    Grz, Kris.

    Thursday, August 14, 2008 2:28 AM
  • User-16411453 posted

    So how do the 3rd party controls go up to 4 gigs.  Are they using another method such as backtround transfer or something.

    Friday, August 15, 2008 1:42 PM
  • User1186257875 posted

    yeah, they must use a different method.  POSTing a file to the server requires the whole file to be read into memory before it is saved to disk.  The worker process has a maximum address space of 2GB therefore the theoretical limit is set to that.  If you have multiple users uploading large files at the same time, you will probably run into problems

    Saturday, August 16, 2008 10:27 AM
  • User541108374 posted

    Hi,

      Are they using another method such as backtround transfer or something.
     

    Yes, they must do it differently. A way would probably be to post it to a custom httphandler that can handle a large stream in chunks and concatenate file snippets together while receiving another chunk of uploaded data. Also a way would be to expose a service that can handle it in such a way. Not always but mostly you see such controls render something like an activex control or java applet. You'll also going to be seeing silverlight upload controls too. You can already use these for multi uploading (http://www.nikhilk.net/Entry.aspx?id=169).

    Grz, Kris.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, August 17, 2008 3:26 AM
  • User775232658 posted
    Thanks, Actualy i do have 5 file upload control on my usercontrol. Initialy all upload control is set visible = false.When i click on Upload another image Link I will show the subsequent file upload control but here is the root of evil the path in the first control get cleared. i want to ratain this values. also note that i am restricted to use AJAX technology. Thanks & Regards
    Thursday, August 21, 2008 5:49 AM