Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Asp.net and uploading large files

Asp.net and uploading large files

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netlearning
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ahmad Safwat
    wrote on last edited by
    #1

    I'm using Asp.net 3.5 on Godaddy, and I need a way for users to upload large files using Asp.net FileUpload Control, I don't want to use a third party I've changed the value of maxRequestLength in web.config as follows: but when uploding a file of about 32 MB, upload process goes well (I can see percentage for the process in the down-left corner of Chrome browser), but after a while, the process restarts !! and after going with upload for a while page crashes without errors (just telling me that page cannot be displayed) The same happens on IE (but of course without percentage) Please help me to solve this issue without third party

    U R 2 Replies Last reply
    0
    • A Ahmad Safwat

      I'm using Asp.net 3.5 on Godaddy, and I need a way for users to upload large files using Asp.net FileUpload Control, I don't want to use a third party I've changed the value of maxRequestLength in web.config as follows: but when uploding a file of about 32 MB, upload process goes well (I can see percentage for the process in the down-left corner of Chrome browser), but after a while, the process restarts !! and after going with upload for a while page crashes without errors (just telling me that page cannot be displayed) The same happens on IE (but of course without percentage) Please help me to solve this issue without third party

      U Offline
      U Offline
      uspatel
      wrote on last edited by
      #2

      It may helps you

      string filename = fuUploadVideo.FileName;
      string path = Server.MapPath("Uploads4");
      string strFinalFileName = Path.GetFileName(fuUploadVideo.FileName);
      long FileLength = fuUploadVideo.PostedFile.ContentLength;
      long uploadchunklimit;
      int SizeLimit = (int)FileLength;
      if (FileLength <= 1024)
      {
      uploadchunklimit = 1;
      SizeLimit = (int)FileLength;
      }
      else if (FileLength > 1024)
      {
      uploadchunklimit = FileLength / 1024;
      SizeLimit = 10;
      }
      else if (FileLength <= 10240 && FileLength > 1024)
      {
      uploadchunklimit = FileLength / 1024;
      }
      else
      {
      uploadchunklimit = FileLength / 1024;
      }

              long lngSize = (long)SizeLimit;
              lngSize = 1024 \* 1024;
              string ext = Path.GetExtension(fuUploadVideo.PostedFile.FileName);
      
              fuUploadVideo.PostedFile.SaveAs(Server.MapPath("~\\\\Uploads4\\\\" + filename));
      
      A 1 Reply Last reply
      0
      • U uspatel

        It may helps you

        string filename = fuUploadVideo.FileName;
        string path = Server.MapPath("Uploads4");
        string strFinalFileName = Path.GetFileName(fuUploadVideo.FileName);
        long FileLength = fuUploadVideo.PostedFile.ContentLength;
        long uploadchunklimit;
        int SizeLimit = (int)FileLength;
        if (FileLength <= 1024)
        {
        uploadchunklimit = 1;
        SizeLimit = (int)FileLength;
        }
        else if (FileLength > 1024)
        {
        uploadchunklimit = FileLength / 1024;
        SizeLimit = 10;
        }
        else if (FileLength <= 10240 && FileLength > 1024)
        {
        uploadchunklimit = FileLength / 1024;
        }
        else
        {
        uploadchunklimit = FileLength / 1024;
        }

                long lngSize = (long)SizeLimit;
                lngSize = 1024 \* 1024;
                string ext = Path.GetExtension(fuUploadVideo.PostedFile.FileName);
        
                fuUploadVideo.PostedFile.SaveAs(Server.MapPath("~\\\\Uploads4\\\\" + filename));
        
        A Offline
        A Offline
        Ahmad Safwat
        wrote on last edited by
        #3

        Thank you for your reply, but I don't understand how this code helps me

        1 Reply Last reply
        0
        • A Ahmad Safwat

          I'm using Asp.net 3.5 on Godaddy, and I need a way for users to upload large files using Asp.net FileUpload Control, I don't want to use a third party I've changed the value of maxRequestLength in web.config as follows: but when uploding a file of about 32 MB, upload process goes well (I can see percentage for the process in the down-left corner of Chrome browser), but after a while, the process restarts !! and after going with upload for a while page crashes without errors (just telling me that page cannot be displayed) The same happens on IE (but of course without percentage) Please help me to solve this issue without third party

          R Offline
          R Offline
          Ravindra Bisen
          wrote on last edited by
          #4

          you can use fileuploader control

          A 1 Reply Last reply
          0
          • R Ravindra Bisen

            you can use fileuploader control

            A Offline
            A Offline
            Ahmad Safwat
            wrote on last edited by
            #5

            Do you mean FileUpload control? Have you read my original post???

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups