(I posted this on www.asp.net/forums, but it was suggested I post my question here. If you follow both forums, I apologise for the double-posting).
Hi,
I installed the Repository module on our public website, and we happily went along and loaded hundreds of docs. We used to have a simple asp app that listed all these documents using a file directory structure.
I just recently discovered that there's another app with a view out there, of the same folders, that I need to retain. This is an asp app that I can't "DNN-ify".
So ... I want to modify the asp app to read from the Repository's database structure to display its data.
So far, so good, I got the display from selected categories working, but ran into a problem with the timestamp the Repository adds. The filename in the db and the actual filename are not the same.
A sample filename from the db would be
W0002147_003.cdc266a7-9c09-40bb-8bd2-dff309407568.pdf
And the physical file may be
W0002147_001.someothertimestamp.pdf
I'm looking at the source code - downloader.aspx.vb and I can see that it strips off the extension, and then works from the first fullstop - so it seems to reconstruct to W0002147_003.pdf --> can't really see how this is useful though.
It's been suggested that I just use the W0002147, and search for the first file that matches this name, but if a user uploads the same doc more than once, I could end up displaying the wrong doc.
Can anyone shed some light on this for me, please?
Thanks!
________________________
Mikeh36 replies as follows:
A couple of reasons why the filename is changed.
1. Security - prevents direct linking to the files or people guessing what the filename is and getting around security permissions.
2. For the exact reason you mentioned about a user uploading the same doc more than once.
What the Repository does when you upload a file is it changes the name of the file to the same as what you're seeing in the db. Then when a user downloads it it strips that information out of the file before it goes to the user. I don't know if it's possible for you to do it in your ASP file or not but perhaps you can apply the same logic (stripping out the extra info) before the filenames are displayed.