Problem problem problem :( Need Help

Discussion in 'ASP General' started by Mike, May 7, 2004.

  1. Mike

    Mike Guest

    I want to upload file to server using below code and i did file size upto 10 mb max...
    but i have some problem that is ... time out and lost connection some body told me to use stream which open connection always but i dont have idea how to use it as i never did asp programming very wel
    is any body tell me where should i can get materail or any one just give me example to upload file to the server in effective way...
    thanks
    If Not File1.PostedFile Is Nothing And File1.PostedFile.ContentLength > 0 The
    Dim fn As String = System.IO.Path.GetFileName(File1.PostedFile.FileName
    Dim SaveLocation As String = Server.MapPath("Data") & "\" & f
    Tr
    File1.PostedFile.SaveAs(SaveLocation
    Response.Write("the file has been uploaded"
    Catch ex As Exceptio
    Response.Write("Error" & ex.Message
    End Tr
    Els
    Response.Write("Please select a file to upload"
    End If
    Mike, May 7, 2004
    #1
    1. Advertising

  2. Mike

    Ray at Guest

    See here please: http://www.aspfaq.com/etiquette.asp?id=5002

    Ray at work

    "Mike" <> wrote in message
    news:...
    > I want to upload file to server using below code and i did file size upto

    10 mb max....
    > but i have some problem that is ... time out and lost connection some body

    told me to use stream which open connection always but i dont have idea how
    to use it as i never did asp programming very well
    > is any body tell me where should i can get materail or any one just give

    me example to upload file to the server in effective way....
    > thanks
    > If Not File1.PostedFile Is Nothing And File1.PostedFile.ContentLength > 0

    Then
    > Dim fn As String =

    System.IO.Path.GetFileName(File1.PostedFile.FileName)
    > Dim SaveLocation As String = Server.MapPath("Data") & "\" & fn
    > Try
    > File1.PostedFile.SaveAs(SaveLocation)
    > Response.Write("the file has been uploaded")
    > Catch ex As Exception
    > Response.Write("Error" & ex.Message)
    > End Try
    > Else
    > Response.Write("Please select a file to upload")
    > End If
    Ray at, May 7, 2004
    #2
    1. Advertising

  3. Mike

    Bullschmidt Guest

    And for classic ASP here is a resource for letting the user upload a
    file:

    ASP File Upload Using VBScript by John R. Lewis - 7/10/2000
    http://aspzone.com/posts/160.aspx

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Consultant
    http://www.Bullschmidt.com
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Bullschmidt, May 11, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TN Bella
    Replies:
    1
    Views:
    2,471
    Edward
    Jun 18, 2004
  2. Teep
    Replies:
    2
    Views:
    765
    Larry Marburger
    Jun 21, 2004
  3. John
    Replies:
    1
    Views:
    394
    John C. Bollinger
    Aug 19, 2004
  4. =?Utf-8?B?Q2hyaXM=?=

    Help Help. I really need some help with this

    =?Utf-8?B?Q2hyaXM=?=, Jan 31, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    560
    =?Utf-8?B?SmFzb24gVmVybWlsbGlvbg==?=
    Jan 31, 2007
  5. ElementX
    Replies:
    9
    Views:
    491
    RedGrittyBrick
    Oct 1, 2008
Loading...

Share This Page