ASP.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 307,118 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 1,986 people online right now. Registration is fast and FREE... Join Now!




Up the limit of my upload

 

Up the limit of my upload

Pablo3728

6 Nov, 2009 - 07:29 AM
Post #1

New D.I.C Head
*

Joined: 13 Oct, 2009
Posts: 43


My Contributions
Hello! Well, I have a web application in asp.net vb.net, and I can upload files with the next code, but I have a limit to upload things. And i won't have this limit, and I don´t know if I only can change the number of the limit or I have to do other thing, this is my code:

CODE
Dim savePath As String = "c:\inetpub\wwwroot\pablo\"
        If (FileUpload1.HasFile) Then
            Dim fileSize As Integer = FileUpload1.PostedFile.ContentLength
            If (fileSize < 5100000) Then
                savePath += FileUpload1.FileName
                FileUpload1.SaveAs(savePath)
                UploadStatusLabel.Text = "Su archivo se ha subido correctamente."
            Else
                UploadStatusLabel.Text = "Su archivo no ha podido subirse debido " + _
                                         "a que excede el límite de subida (5MB)"
            End If
        Else
            UploadStatusLabel.Text = "No ha especificado el archivo a subir."
        End If


Thank you! smile.gif

User is offlineProfile CardPM
+Quote Post


PsychoCoder

RE: Up The Limit Of My Upload

6 Nov, 2009 - 08:20 AM
Post #2

I Code, Therefore I am
Group Icon

Joined: 26 Jul, 2007
Posts: 14,934



Thanked: 517 times
Dream Kudos: 11550
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
To allow the uploading of larger files locate the system.web section in the web.config file and add this line

CODE

<httpRuntime  maxRequestLength="7168" requestLengthDiskThreshold="7168"/>


And change the values for maxRequestLength and requestLengthDiskThreshold to the value you wish to have. Remember the size is in kilobytes, the default is 4096 KB (4 MB)
User is offlineProfile CardPM
+Quote Post

Pablo3728

RE: Up The Limit Of My Upload

6 Nov, 2009 - 08:47 AM
Post #3

New D.I.C Head
*

Joined: 13 Oct, 2009
Posts: 43


My Contributions
Thank you PsychoCoder. I have a duve wiht this, I put this line in the web conifg, later than do this, It is all right doing the next change?

<httpRuntime maxRequestLength="30000" requestLengthDiskThreshold="30000"/>

Dim fileSize As Integer = FileUpload1.PostedFile.ContentLength
If (fileSize < 30000000) Then

This resolved the problem?




User is offlineProfile CardPM
+Quote Post

BigDaddyCoder

RE: Up The Limit Of My Upload

17 Nov, 2009 - 11:06 AM
Post #4

New D.I.C Head
*

Joined: 16 Nov, 2009
Posts: 2



Thanked: 1 times
My Contributions
Pablo,

You might want to look into the Brettle Neat Upload control.

http://www.brettle.com/neatupload

- BDC
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 01:34PM

Live ASP.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month