Serge,
Think about your question and what you know about the files you would like
to refer to.
Not to belittle you, but a full path can become pretty long, especially if
it is a UNC. Web Query strings have a buffer size limit and you could risk
exceeding that with a full path. If all your files are stored in a common
folder, you could recieve a perfomance hit indexing and fetching files from
that source.
Each file path part has a known length limitation and would be easily
reconstructed given that each part was stored independantly.
Only you can answer the risk/reward tradeoff questions. I would recommend
that if there are to be a lot of files involved and/or multiple file
locations that you break up the file path and store each in a database or
file see example.
example:
File_Table
PathID int IDENTITY (1,1),
FileName Varchar(254) not null, --max file part len is 254 (NT Servers
can only have 16 char names so \\uncpath will always work)
ParentPathID int,
PropertyFlag int,
Size float(9),
LastAccessed datetime,
LastModified datetime,
CheckedOut datetime,
CheckedOutBy int,
File_Flags
Directory=2
File =4
Readonly =8
the path \\myfileserver\myfileshare\some directory\some nested
directory\some file.ext
file size is 150KB
becomes
1, \\myfileserver, Null, 6, 0, getdate(), getdate(), null, null
2, myfileshare, 1, 6, 0, getdate(), getdate(), null, null
3, some directory, 2, 6, 0, getdate(), getdate(), null, null
4, some nested directory, 3, 6, 0, getdate(), getdate(), null, null
5, some file, 4, 10, 150000, getdate(), getdate(), null, null
client request would be
user's userid is 15
http://myserver/myapp/getfile.aspx?myfile=5&UID=15
the data row would look like
5, some file, 4, 10, 150000, getdate(), 'Unchanged Date', getdate(), 15