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 name losing path.

File name losing path.

Scheduled Pinned Locked Moved ASP.NET
helphtmlcom
2 Posts 1 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.
  • D Offline
    D Offline
    dspyank
    wrote on last edited by
    #1

    Hey all, I am having a major problem trying to pull up a word file that has been selected by the user using an HTML file input box (open file dialog box). If I run it from my computer, the whole path is there when it tries to find the file selected. If I run it on the webserver, it loses the path of the document. Here is my code: protected void openWord() { string pathname = File1.Value.ToString(); //HTML File Input Control //set path of word doc you are opening object fileName = pathname; object readOnly = false; object isVisible = true; object missing = System.Reflection.Missing.Value; //make word document appear WordObj.Visible = true; //open specified word document Microsoft.Office.Interop.Word.Document wordDoc = WordObj.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing); When I run this on my machine, its fine, the webserver has word installed on it. Please help! Thank you in advance! Dave

    D 1 Reply Last reply
    0
    • D dspyank

      Hey all, I am having a major problem trying to pull up a word file that has been selected by the user using an HTML file input box (open file dialog box). If I run it from my computer, the whole path is there when it tries to find the file selected. If I run it on the webserver, it loses the path of the document. Here is my code: protected void openWord() { string pathname = File1.Value.ToString(); //HTML File Input Control //set path of word doc you are opening object fileName = pathname; object readOnly = false; object isVisible = true; object missing = System.Reflection.Missing.Value; //make word document appear WordObj.Visible = true; //open specified word document Microsoft.Office.Interop.Word.Document wordDoc = WordObj.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing); When I run this on my machine, its fine, the webserver has word installed on it. Please help! Thank you in advance! Dave

      D Offline
      D Offline
      dspyank
      wrote on last edited by
      #2

      sorry, Ill give you some output to clarify. On my machine: C:\foldername\worddocumentselected.doc On the webserver: worddocumentselected.doc (path does not exist!) Why am I losing the "C:\foldername\"? Thanks Again! Dave

      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