rejetto forum
Software => HFS ~ HTTP File Server => Topic started by: carpediem on August 12, 2004, 11:31:58 AM
-
After using HFS for a while I've come to miss a "function" that would be very handy for me at least. Say I want to stop sharing a file, but at the same time I want to keep the server up. Instead of getting an error message, it would be nice if I could redirect them to another file of my choice.
Example
I have a file called file01.exe that I'm sharing. I don't want to share it anymore, so right clicking on the file could give me the option to "stop sharing and redirect". In the option for that I could just point to another file/url of my choice. Say a "info.htm" where I maybe explain why the file is no longer there and maybe even re-direct to an off-site url that holds a mirror of the file.
-
You can unshare a file any time without stopping the server. As soon as the user refreshes the browser, the file will be removed from the listing. The only time they will get an error is if they try to download from an outdated listing without refreshing.
If you don't like the standard File Not Found error message you can customize it by editing the template file. Or you can create a custom "File has been removed" text or html file, and put it in place of the removed file.
-
right-click the file, Menu->access-for-users->NONE
-
right-click the file, Menu->access-for-users->NONE
That doesn't unshare it, it unprotects it so it is shared for everybody. I suppose you could create a user called NoAccess and password protect the file -- right click, Menu -> set user access.
-- bug report --> I tried password protecting a file, and when I tried to download the file I was prompted for a password. The password prompt referenced the file by the comment instead of by the file name.
-
You can unshare a file any time without stopping the server. As soon as the user refreshes the browser, the file will be removed from the listing. The only time they will get an error is if they try to download from an outdated listing without refreshing.
If you don't like the standard File Not Found error message you can customize it by editing the template file. Or you can create a custom "File has been removed" text or html file, and put it in place of the removed file.
First paragraph doesn't do what I want.
Second paragraph isn't possible, is it? If i have a file.exe shared, and want to remove it from the share but at the same time give a notice to the user why it's not there anymore, how can i "replace" it as you say? If that user clicks a direct link to that exe he will get the default "file not found" page, right? I can't give the user a custom message about why that file isn't there. That's why i would want to "unshare it and redirect to a file or address of my choice".
-
my advice:
remove file01.exe
create a new virtual folder called "file01.exe"
insert there an index.html with your message.
right-click on the folder and click Default file mask.
set it as index.html
-
First paragraph doesn't do what I want.
Second paragraph isn't possible, is it? If i have a file.exe shared, and want to remove it from the share but at the same time give a notice to the user why it's not there anymore, how can i "replace" it as you say? If that user clicks a direct link to that exe he will get the default "file not found" page, right? I can't give the user a custom message about why that file isn't there. That's why i would want to "unshare it and redirect to a file or address of my choice".
First paragraph was just a response to wanting to stop sharing a file and still keep the server up.
Second paragraph was intended more along the lines of inserting a placekeeper file. I wasn't thinking of direct links when I posted it, it wouldn't work for that.
Use Rejetto's advice above, it will do what you want.