Search:
Namespaces
Discussions
.NET v1.1
Feedback
File upload question
Messages
Related Types
This message was discovered on
ASPFriends.com 'ngfx-io' list
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Karen Healey
-- Moved from [aspngibuyspy] to [ngfx-io] by Yannick Smits <
Click here to reveal e-mail address
> --
Hi,
I'm trying to write my own File Upload module for the Portal and am a little confused about WHERE to put the file.
Currently I have:
InputFile.PostedFile.SaveAs("c:\\Temp\\"+ParsedFileName);
Which works great to save the file in c:\Temp.
But I want to save files in the images subdirectory of my portal and I'm not sure how to specify that directory. I don't want to hard code in the directory name (or even put it in web.config). Is there a way to find out where my home directory is for the web page? Then I could just append ~/images to it.
FYI... there are alot of free File Upload controls available but I wanted to give this a try myself since it seemed easy.
Karen
Reply to this message...
Steve Sharrock (VIP)
Take a look at either
Page
.MapPath( "~" ) or Server.MapPath( "~" );
You could also use MapPath("Images") -- (or something like this).
HTH
Steve Sharrock
programmer / designer
www.sharkcode.com
-----Original Message-----
From: Karen Healey [mailto:
Click here to reveal e-mail address
]
Sent: Saturday, September 07, 2002 4:13 AM
To: ngfx-io
Subject: [ngfx-io] File upload question
-- Moved from [aspngibuyspy] to [ngfx-io] by Yannick Smits
<
Click here to reveal e-mail address
> --
Hi,
I'm trying to write my own File Upload module for the Portal and am a
little confused about WHERE to put the file.
Currently I have:
InputFile.PostedFile.SaveAs("c:\\Temp\\"+ParsedFileName);
Which works great to save the file in c:\Temp.
But I want to save files in the images subdirectory of my portal and I'm
not sure how to specify that directory. I don't want to hard code in
the directory name (or even put it in web.config). Is there a way to
find out where my home directory is for the web page? Then I could just
append ~/images to it.
FYI... there are alot of free File Upload controls available but I
wanted to give this a try myself since it seemed easy.
Karen
| [ngfx-io] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.aspfriends.com/aspfriends/ngfx-io.asp
= JOIN/QUIT
Reply to this message...
Karen Healey
Thanks Steve for pointing me in the right direction. Here is the line of
code I used...
string SaveAsFileName =
Page
.MapPath( "~\\images" ) + "\\" + ParsedFileName;
Thanks!
Karen
----- Original Message -----
From: "Steve Sharrock" <
Click here to reveal e-mail address
>
To: "ngfx-io" <
Click here to reveal e-mail address
>
Sent: Wednesday, August 07, 2002 19:26
Subject: [ngfx-io] RE: File upload question
[Original message clipped]
Reply to this message...
Biplab De
Hi,
U can use Request.ServerVariables("APPL_PHYSICAL_PATH") to get physical path of UR portal's Vartual path.
Biplab De.
--- "Karen Healey" <
Click here to reveal e-mail address
> wrote:
[Original message clipped]
_____________________________________________________________
Washington DC's Largest FREE Email service. --->
http://www.DCemail.com
---> A Washington Online Community Member --->
http://www.DCpages.com
_____________________________________________________________
Promote your group and strengthen ties to your members with
Click here to reveal e-mail address
by Everyone.net http://www.everyone.net/?btn=tag
Reply to this message...
Brian Bilbro (VIP)
The portal has an example of using the FileUpload capabilities of .NET.
Check out the EditDocs.aspx file in the DesktopModules folder.
--
Brian
[Original message clipped]
directory name (or even put it in web.config). Is there a way to find out
where my home directory is for the web page? Then I could just append
~/images to it.
[Original message clipped]
Reply to this message...
System.Web.UI.Page
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com