A
Anton Sommer
Hello folks,
I would like to let some authenticated users download certain files that
should not be downloadable for other users. All files are stored in one
directory with a unique filename supplied by the DB. I would feel better if
this directory was not directly accessible from the net (not in the path of
inetpub/application/.. )
I have tested three possibilities to let users download files, but each of
them have one thing that keeps me from using it:
1. Response.Redirect("/UPDTest/anton/Bild008.exe"): here the user gets a
filename suggested (what is vital for me) but the files are freely
accessible. ( If someone knows a possibility to change the free
accessibility please let me know)
2. Response.WriteFile("C:\temp\Bild 001.jpg"): here the user does not get
the right filename suggested but I need to do that! (of course it is the
filename of the aspx file)
3. Copy the file from the inaccessible directory to an accessible
directory, rename the file, use response.redirect to download it and delete
the file then after a certain period. But I can only delete the file after a
fixed period of time without knowing if the download has already completed
nor can I keep other users from downloading the file in that very period nor
can I keep the same user from downloading the file again without tracking it
in the application. Does anyone know a solution for that?
So what are your suggestions on that and are there other possibilities to
achieve what I am trying to do?
Thanks
Anton
I would like to let some authenticated users download certain files that
should not be downloadable for other users. All files are stored in one
directory with a unique filename supplied by the DB. I would feel better if
this directory was not directly accessible from the net (not in the path of
inetpub/application/.. )
I have tested three possibilities to let users download files, but each of
them have one thing that keeps me from using it:
1. Response.Redirect("/UPDTest/anton/Bild008.exe"): here the user gets a
filename suggested (what is vital for me) but the files are freely
accessible. ( If someone knows a possibility to change the free
accessibility please let me know)
2. Response.WriteFile("C:\temp\Bild 001.jpg"): here the user does not get
the right filename suggested but I need to do that! (of course it is the
filename of the aspx file)
3. Copy the file from the inaccessible directory to an accessible
directory, rename the file, use response.redirect to download it and delete
the file then after a certain period. But I can only delete the file after a
fixed period of time without knowing if the download has already completed
nor can I keep other users from downloading the file in that very period nor
can I keep the same user from downloading the file again without tracking it
in the application. Does anyone know a solution for that?
So what are your suggestions on that and are there other possibilities to
achieve what I am trying to do?
Thanks
Anton