Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Uploading file to another drive

Reply
Thread Tools

Uploading file to another drive

 
 
Mark Brown
Guest
Posts: n/a
 
      05-24-2010
I'm trying to create a web page that allows the user to upload a file. If I set the save path somewhere on drive C:\, it works just fine. However, I need it to save elsewhere, like drive E:\. When I do this, I get an error saying "Could not find a part of the path '...' and then is lists the path. All the pieces of the path are there and if you change E: to C:, it works.

Is there some concept I'm missing or is it just not possible for a web page to save someplace other than C:\?

Here's the code that does the saving:

Dim fn As String = System.IO.Path.GetFileName(File2.PostedFile.FileNa me)
Dim SaveLocation As String = "e:\webtst\images\" & Session("CADNum") & "\" & fn

Try

Directory.CreateDirectory("e:\webtst\images\" & Session("CADNum"))
File2.PostedFile.SaveAs(SaveLocation)
SaveLocInfo(SaveLocation)

Catch ex As Exception
Dim Tmp As String = ex.Message
End Try

The session variable does contain a value.

Thanks,
Mark
 
Reply With Quote
 
 
 
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      05-24-2010
"Mark Brown" <(E-Mail Removed)> wrote in message
news:uVH8zI1%(E-Mail Removed)...

> Is there some concept I'm missing or is it just not possible for a web
> page to save someplace other than C:\?


Does the webserver actually have an E:\ drive mapped...?


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
 
 
 
Mark Brown
Guest
Posts: n/a
 
      05-24-2010
On the server it will run on, the E: drive is a local harddrive. On my
development system, the E: drive was created by a SUBST command.

"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Mark Brown" <(E-Mail Removed)> wrote in message
> news:uVH8zI1%(E-Mail Removed)...
>
>> Is there some concept I'm missing or is it just not possible for a web
>> page to save someplace other than C:\?

>
> Does the webserver actually have an E:\ drive mapped...?
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net



 
Reply With Quote
 
Mark Brown
Guest
Posts: n/a
 
      05-24-2010
For grins I loaded the program on the server it will be running on...and it
worked like a champ. I guess it doesn't like drives created by SUBST.


"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Mark Brown" <(E-Mail Removed)> wrote in message
> news:uVH8zI1%(E-Mail Removed)...
>
>> Is there some concept I'm missing or is it just not possible for a web
>> page to save someplace other than C:\?

>
> Does the webserver actually have an E:\ drive mapped...?
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net



 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      05-26-2010
On May 24, 9:46*pm, "Mark Brown" <(E-Mail Removed)> wrote:
> For grins I loaded the program on the server it will be running on...and it
> worked like a champ. *I guess it doesn't like drives created by SUBST.
>
> "Mark Rae [MVP]" <(E-Mail Removed)> wrote in messagenews:(E-Mail Removed)...
>
>
>
> > "Mark Brown" <(E-Mail Removed)> wrote in message
> >news:uVH8zI1%(E-Mail Removed)...

>
> >> Is there some concept I'm missing or is it just not possible for a web
> >> page to save someplace other than C:\?

>
> > Does the webserver actually have an E:\ drive mapped...?

>
> > --
> > Mark Rae
> > ASP.NET MVP
> >http://www.markrae.net


I think that the problem there is that the drive created by subst is
available only within the process of the user that created it. That's
why you can't access E:\ at IIS.

Instead of subst try to use Junction by Mark Russinovich
http://technet.microsoft.com/en-us/s.../bb896768.aspx
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving uploading file on another server rose ASP .Net 0 05-12-2008 05:18 AM
making a new drive the boot drive in a 2 hard drive system hi2u Computer Support 3 07-30-2007 08:45 PM
how to check whether a drive is a network drive or drive from attached hard-disk shailesh Python 1 03-28-2007 12:57 PM
ftp uploading vs. control panel uploading Dung Ping HTML 10 01-16-2006 10:43 AM
Imaging a drive to another brand hard drive ? Charlie Computer Support 8 08-17-2005 02:11 PM



Advertisments