Creating Custom control like File upload control in asp.net

Last post 08-21-2008 5:49 AM by shahid13. 10 replies.

Sort Posts:

  • Creating Custom control like File upload control in asp.net

    08-12-2008, 9:01 AM
    • Member
      11 point Member
    • shahid13
    • Member since 06-07-2008, 6:14 AM
    • Ahmedabad
    • Posts 23
    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
    Shahid M Shaikh
    Filed under:
  • Re: Creating Custom control like File upload control in asp.net

    08-12-2008, 9:35 AM
    • All-Star
      122,915 point All-Star
    • XIII
    • Member since 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 13,604
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Hi,

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

    Grz, Kris.

  • Re: Creating Custom control like File upload control in asp.net

    08-12-2008, 7:18 PM
    • Participant
      1,854 point Participant
    • jkirkerx
    • Member since 12-07-2007, 7:52 AM
    • Huntington Beach CA
    • Posts 435

     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 

  • Re: Creating Custom control like File upload control in asp.net

    08-13-2008, 2:13 AM
    • All-Star
      122,915 point All-Star
    • XIII
    • Member since 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 13,604
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    jkirkerx:
    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.

  • Re: Creating Custom control like File upload control in asp.net

    08-13-2008, 3:01 PM
    • Participant
      1,854 point Participant
    • jkirkerx
    • Member since 12-07-2007, 7:52 AM
    • Huntington Beach CA
    • Posts 435

    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.

     

  • Re: Creating Custom control like File upload control in asp.net

    08-13-2008, 4:38 PM
    • Star
      8,650 point Star
    • DavidKiff
    • Member since 12-07-2006, 11:07 PM
    • Hertfordshire, UK
    • Posts 1,733

    jkirkerx:
    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!

  • Re: Creating Custom control like File upload control in asp.net

    08-14-2008, 2:28 AM
    • All-Star
      122,915 point All-Star
    • XIII
    • Member since 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 13,604
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    DavidKiff:
    I think its due to the maximum HTTP post size

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

    Grz, Kris.

  • Re: Creating Custom control like File upload control in asp.net

    08-15-2008, 1:42 PM
    • Participant
      1,854 point Participant
    • jkirkerx
    • Member since 12-07-2007, 7:52 AM
    • Huntington Beach CA
    • Posts 435

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

  • Re: Creating Custom control like File upload control in asp.net

    08-16-2008, 10:27 AM
    • Star
      8,650 point Star
    • DavidKiff
    • Member since 12-07-2006, 11:07 PM
    • Hertfordshire, UK
    • Posts 1,733

    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

  • Re: Creating Custom control like File upload control in asp.net

    08-17-2008, 3:26 AM
    Answer
    • All-Star
      122,915 point All-Star
    • XIII
    • Member since 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 13,604
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Hi,

    jkirkerx:
      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.

  • Re: Creating Custom control like File upload control in asp.net

    08-21-2008, 5:49 AM
    • Member
      11 point Member
    • shahid13
    • Member since 06-07-2008, 6:14 AM
    • Ahmedabad
    • Posts 23
    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
    Shahid M Shaikh
Page 1 of 1 (11 items)