Problem problem problem :( Need Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    Problem problem problem :( Need Help

    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.PostedFil e Is Nothing And File1.PostedFil e.ContentLength > 0 The
    Dim fn As String = System.IO.Path. GetFileName(Fil e1.PostedFile.F ileName
    Dim SaveLocation As String = Server.MapPath( "Data") & "\" & f
    Tr
    File1.PostedFil e.SaveAs(SaveLo cation
    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
  • Ray at

    #2
    Re: Problem problem problem :( Need Help

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

    Ray at work

    "Mike" <anonymous@disc ussions.microso ft.com> wrote in message
    news:69F0D300-2284-48F7-A6E7-3AB563F651A3@mi crosoft.com...[color=blue]
    > I want to upload file to server using below code and i did file size upto[/color]
    10 mb max....[color=blue]
    > but i have some problem that is ... time out and lost connection some body[/color]
    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[color=blue]
    > is any body tell me where should i can get materail or any one just give[/color]
    me example to upload file to the server in effective way....[color=blue]
    > thanks
    > If Not File1.PostedFil e Is Nothing And File1.PostedFil e.ContentLength > 0[/color]
    Then[color=blue]
    > Dim fn As String =[/color]
    System.IO.Path. GetFileName(Fil e1.PostedFile.F ileName)[color=blue]
    > Dim SaveLocation As String = Server.MapPath( "Data") & "\" & fn
    > Try
    > File1.PostedFil e.SaveAs(SaveLo cation)
    > 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[/color]


    Comment

    • Bullschmidt

      #3
      Re: Problem problem problem :( Need Help

      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


      Best regards,
      J. Paul Schmidt, Freelance ASP Web Consultant
      Do you have an idea for a database on the Web? Hi! I'm a freelance Web and/or database developer who can make database information available 'live' on the Web.

      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!

      Comment

      Working...