rejetto forum
Software => HFS ~ HTTP File Server => Topic started by: joesloan on February 05, 2007, 02:50:11 PM
-
I am not a programer, and would like a new feature which seems simple to do to me, but probably is complicated as everything simple is.
I would like to post a link to a specific file to be downloaded, when clicked on, they are given the option to "save or cancel" the standard pop-up screen. Once downloaded they are redirected to my websites homepage(if possible).
also, I would like them to access only the specified file, and not be able to use the url to back into the directory structure to access other folders or files.
Could this be done without too much work, I know I can't do it, can someone help?
Thanks joe
-
I would like to post a link to a specific file to be downloaded, when clicked on, they are given the option to "save or cancel" the standard pop-up screen. Once downloaded they are redirected to my websites homepage(if possible).
i know no way to get this, sorry
also, I would like them to access only the specified file, and not be able to use the url to back into the directory structure to access other folders or files.
(expert mode) right click -> "Browsable" ("Let browse" in old versions)
disable it
-
Thanks for the help, if that going to my website would be great if it can ever be done!
thanks
-
I would like to post a link to a specific file to be downloaded, when clicked on, they are given the option to "save or cancel" the standard pop-up screen.
This is possible and it can be done with javascript. It would require every file in the file table to link to a js link instead of a file link.
If i'm bored enough when I get home, i'll get a simple version of it working for you.
Once downloaded they are redirected to my websites homepage(if possible).
This is possibly doable...using javascript of course. HFS currently supports an active transfer frame. I suppose it could be set so that
if an active transfer hits 100%, the page is redirected back to the HFS homepage.
Both these solutions seem pretty redundant, but i suppose they'd do what you want them to do.
Start PMing That Stevens Guy wildly and nag him into doing stuff for you :P He likes it.
-
OK joesloan, i've started off the code for you. You'll need to make a few adjustments to get it doign everything you want though.
Here's the code.
Stick this in to modify the link for every single file. If you only want the popup window to occur for certain files,
change [file] to [file.<ext>].
[file]
<tr class=off onmouseover="this.className='on'" onmouseout="this.className='off'">
<td class=rw style="border-left:0px;"><a href="javascript:onclick=popItem('%folder%%item-url%');"> <img align=top src="/~img_file" alt=""> %item-name%</a>%new%%comment%
<td class=rw align=center>%item-size%</td>
<td class=rw align=center>%item-modified%</td>
<td class="rw off" align=center width=175>%item-dl-count%<br><div style="border-top:1px solid #fff;"></td>
</tr>
Here is the script that actually does the popup and this is what you'll need to modify.
<script type="text/javascript" language="javascript">
function popItem(file)
{
popup=window.open('','Popup','height=325,width=490,resizable=yes,scrollable=yes');
var win = popup.document;
win.write("<a href=\""+file+"\">Download Now</a> <a href=\"javascript:close()\">Cancel</a>");
}
</script>
Hope this helps you.