Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Linking to an uploaded file


Message #1 by "Jon Hilton" <jmh@s...> on Wed, 30 Jan 2002 11:59:17 -0000
This is a multi-part message in MIME format.



------=_NextPart_000_0007_01C1A985.8B40F880

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



Hi folks



I'm working on a file upload system and have hit a stumbling block.



Summary of system:



User can view folders in given path (hard-coded into page)

User can click on a subfolder to retreive list of files (and sub

folders) in that subfolder

User can upload a file to the directory they are currently viewing



Problem is, when a user has uploaded a file I want them to be able to

view that file (I just want a straightforward link to the file).



I'm not sure how to construct a link to the file.



Evidentally the link needs to include the virtual path of the

application...



http://whatever.com/upload/



it also needs to include the folder(s) under which this the file

resides...



examples/part1/text/



and also the file name of the file...



example1.txt



I'm probably missing something obvious but I've managed to get the vpath

of the application sorted using



Request.ApplicationPath



I've managed to get the filename using



Upload.PostedFile.FileName



I'm stuck now trying to identify the address(es) of the subfolder(s)

into which the file has been uploaded.



The only variables I have available to me are the full path to the

file...



eg. c:\\intranet\\examples\part1\\text\\



and the full path of the root folder for the system...



eg. c:\\intranet\\



Any thoughts?



Jon Hilton

Web Coordinator

Shrewsbury Sixth Form College

www.ssfc.ac.uk







  Return to Index