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. File Upload

File Upload

Scheduled Pinned Locked Moved ASP.NET
helpdatabasesysadminquestion
3 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.
  • V Offline
    V Offline
    vasini
    wrote on last edited by
    #1

    I have a text file(which is in different server) to be uploaded to database table. When we browse the file, and click upload button, it should redirect to other aspx page and from where the path of the file will be sent to a procedure to insert the values in the text file to a table. But when I select a file and click the upload button its giving "Page cannot be Displayed" error. My code is like this: Try Dim inputFile As New FileInfo(txtfilePath.PostedFile.FileName) Try If (inputFile.Length > 1) Then lblStatus.Text = "File is empty" Else Response.Redirect("Form2.aspx?file=" & HttpUtility.UrlPathEncode(txtfilePath.PostedFile.FileName)) End If Catch ex As Exception lblStatus.Text = ex.Message End Try Catch ex As Exception lblStatus.Text = "File doesn't exist or is inaccessible" End Try When I click upload button its saying page cannot be displayed. Please if anyone can help me for fixing this, I'll be thankful. Thank you. Vasini

    P 1 Reply Last reply
    0
    • V vasini

      I have a text file(which is in different server) to be uploaded to database table. When we browse the file, and click upload button, it should redirect to other aspx page and from where the path of the file will be sent to a procedure to insert the values in the text file to a table. But when I select a file and click the upload button its giving "Page cannot be Displayed" error. My code is like this: Try Dim inputFile As New FileInfo(txtfilePath.PostedFile.FileName) Try If (inputFile.Length > 1) Then lblStatus.Text = "File is empty" Else Response.Redirect("Form2.aspx?file=" & HttpUtility.UrlPathEncode(txtfilePath.PostedFile.FileName)) End If Catch ex As Exception lblStatus.Text = ex.Message End Try Catch ex As Exception lblStatus.Text = "File doesn't exist or is inaccessible" End Try When I click upload button its saying page cannot be displayed. Please if anyone can help me for fixing this, I'll be thankful. Thank you. Vasini

      P Offline
      P Offline
      Parwej Ahamad
      wrote on last edited by
      #2

      Plz could u confirmed, is it working fine for local machine files. If yes then you first save the file in locat system when upload the file from different server, then redirect the page with local file path. If no then plz check before redirect first sure your Provided URL is write or wrong.

      Parwej Ahamad g_parwez@rediffmail.com

      B 1 Reply Last reply
      0
      • P Parwej Ahamad

        Plz could u confirmed, is it working fine for local machine files. If yes then you first save the file in locat system when upload the file from different server, then redirect the page with local file path. If no then plz check before redirect first sure your Provided URL is write or wrong.

        Parwej Ahamad g_parwez@rediffmail.com

        B Offline
        B Offline
        BINOVAR
        wrote on last edited by
        #3

        if u r using fileupload control in your page ..plz check n tell me if the file size is greater than 2MB.

        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