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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Cannot Upload from code

Cannot Upload from code

Scheduled Pinned Locked Moved ASP.NET
help
2 Posts 2 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
    abdelhameed81
    wrote on last edited by
    #1

    hi, i am using a library to allow users to upload files through the application, it was working well but when my host provider changed the domain address, i also changed my code to fit the new one but it works with some and others it gives me an error of (Cannot find part of the path......) or (cannot find file windows/system32/...) please help me thanks abdelhameed81

    G 1 Reply Last reply
    0
    • A abdelhameed81

      hi, i am using a library to allow users to upload files through the application, it was working well but when my host provider changed the domain address, i also changed my code to fit the new one but it works with some and others it gives me an error of (Cannot find part of the path......) or (cannot find file windows/system32/...) please help me thanks abdelhameed81

      G Offline
      G Offline
      Goalie35
      wrote on last edited by
      #2

      Are you using "server.mappath" to specify your directory? Without seeing your code, the best I can do is provide an example of a solution I'm using that uploads successfully. In this sample, I upload the file into an "Uploads" folder on my server: .aspx file: ----------------------------------------------------------- ----------------------------------------------------------- .cs codebehind file: ----------------------------------------------------------- #region Click Events protected void btnUpload_Click(object sender, EventArgs e) { string targetDirectory; if (fu_File1.HasFile) { targetDirectory = Server.MapPath(@"Uploads/" + fu_File1.FileName); fu_File1.SaveAs(targetDirectory); string dir = fu_File1.PostedFile.FileName; Response.Write(dir); } } #endregion -------------------------------------------------------------- Hope that helps. -Goalie35

      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