Lunarpages Web Hosting Forum

Author Topic: Upload/Open File on Windows Server  (Read 5324 times)

Offline abarrett

  • Newbie
  • *
  • Posts: 3
Upload/Open File on Windows Server
« on: January 17, 2011, 07:17:39 AM »
I have a project in which we need to either upload file OR scan a directory for new files and process them, store their data in a database, etc.  We are running c#.NET on a windows server with Lunar Pages.

The problem I have running in to, in short:

Could not find a part of the path 'f:\windows\system32\inetsrv\myFiles\myFile.csv

This happens after uploading a file, using the SaveAs function and then trying to open the file.  It also happens when I create a directory and upload the files to the server via FTP and attempt to open them.

Code: [Select]
String myFilePath = Directory.GetCurrentDirectory() + "\\myFiles\\myFile.csv";
StreamReader fileStream = new StreamReader(myFilePath);

Any help would be greatly appreciated.

Offline abarrett

  • Newbie
  • *
  • Posts: 3
Re: Upload/Open File on Windows Server
« Reply #1 on: January 19, 2011, 12:20:46 PM »
Bueller?  Bueller?

Offline Lesta G

  • Space Explorer
  • ***
  • Posts: 9
Re: Upload/Open File on Windows Server
« Reply #2 on: January 23, 2011, 07:26:22 PM »
have you checked your  process has the correct access permissions to the directory?

MWaqas

  • Guest
Re: Upload/Open File on Windows Server
« Reply #3 on: February 09, 2011, 10:53:26 AM »
Hello,

You should use the absolute or full path like C:/inutpub/vhosts/yourdomain.com (please write to windows@lunarpages.com to find the actual path) or if you want to use the path like you are using now please enable parent paths (from Plesk) or ask us to do so, do note that the destination directory must have write/full permissions too (you can also ask us to do that too). We will be glad to help you out with this.