rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: gauravforyouall on February 13, 2009, 09:36:40 PM

Title: Rename file on download
Post by: gauravforyouall on February 13, 2009, 09:36:40 PM
Hi. i would like to know that if it is possible to rename file when user is downloading that
Like suppose file name is 1.mp3 i want to rename it as 1.1 or 1.2 or anyother thing just when user is renaming it.

Title: Re: Rename file on download
Post by: rejetto on February 13, 2009, 10:39:15 PM
i'm not sure i understand your need.
you can add 1.mp3 to HFS, then virtually rename it to 1.1
the physical file will stay the same, but it will appear and be downloaded as 1.1
Title: Re: Rename file on download
Post by: gauravforyouall on February 15, 2009, 05:38:53 AM
exactly, this is what i want but i dont want to rename all files myself, as i have lot of files isnt there some way by which files are automaticlly renamed on downloading
Title: Re: Rename file on download
Post by: rejetto on February 15, 2009, 01:33:19 PM
renamed automatically by which rule?
Title: Re: Rename file on download
Post by: gauravforyouall on February 15, 2009, 01:35:28 PM
By say number of downloads or any rule, or any fixed file name only let it be getfile.
Title: Re: Rename file on download
Post by: rejetto on February 15, 2009, 01:40:18 PM
hfs has not a feature to let you specify a different name for the same file at every download.
Title: Re: Rename file on download
Post by: gauravforyouall on February 15, 2009, 01:41:08 PM
I love this software
Title: Re: Rename file on download
Post by: rejetto on February 15, 2009, 01:48:19 PM
thank you :)
Title: Re: Rename file on download
Post by: gauravforyouall on February 15, 2009, 01:59:31 PM
could you please tell me how to do that? i mean automatically renaming file i am very bad in scripts and i dont follow anything related to this :( so i will need help
Title: Re: Rename file on download
Post by: rejetto on February 15, 2009, 02:03:58 PM
maybe you misread my previous post: hfs has NOT such feature.
but....wait, it is possible, by making a script associated to the [download completed].
but it will have to physically rename the file.
it takes some time to make it, and i have no time now. i hope someone else will enjoy making the script for you.
Title: Re: Rename file on download
Post by: gauravforyouall on February 15, 2009, 02:20:46 PM
Ohok thanks a lot ! This software is good!
Title: Re: Rename file on download
Post by: AYEHAN on February 15, 2009, 07:42:19 PM
Rejetto related to this topic some how

is it possible that hfs willrename file when user download it

like file is added to HFS as Linkin_Park.mp3 and when user download andsave it it goes to 1.mp3 as a default name right?

cant HFS rename the file(or say add website/host name or other predefined word) and send download to user for example Linkin_Park_rejetto.com.mp3


Possible?
Title: Re: Rename file on download
Post by: rejetto on February 16, 2009, 10:07:43 AM
at the moment HFS can only rename the file, cannot change the name of the download itself.

is it so useful?
Title: Re: Rename file on download
Post by: gauravforyouall on February 16, 2009, 12:32:45 PM
Ya. it would be very useful that if it change name on download .............
Title: Re: Rename file on download
Post by: rejetto on February 16, 2009, 03:10:06 PM
i meant: if you mind explaining me why it is, i can consider adding it to the to-do-list
Title: Re: Rename file on download
Post by: gauravforyouall on February 16, 2009, 03:16:21 PM
Oh... I misunderstood your question  ;D ya, many a times we need to transfer files and they are blocked due to security reasons or any other firewall and mostly they check it by their extension only not by the file header so we need to do it manual rename on each file and then reciever can change extension later on... If that is automatic it would be helpful . Like me , i need to transfer daily around 90-100 files over network as my project is music based and my educaitonal institute firewall doesnt allows music files to be transfered i need to rename them all so ...
Title: Re: Rename file on download
Post by: luca69 on February 16, 2009, 04:29:38 PM
Oh... I misunderstood your question  ;D ya, many a times we need to transfer files and they are blocked due to security reasons or any other firewall and mostly they check it by their extension only not by the file header so we need to do it manual rename on each file and then reciever can change extension later on... If that is automatic it would be helpful . Like me , i need to transfer daily around 90-100 files over network as my project is music based and my educaitonal institute firewall doesnt allows music files to be transfered i need to rename them all so ...
...Create a zip file with a password (so that cannot be opened) to transfer that many files into one step ;)
Title: Re: Rename file on download
Post by: gauravforyouall on February 16, 2009, 04:34:14 PM
:( suppose i have 10000 files or more and i dont know which will be downloaded that can be any na... :( i cant create and save each as ZIP
Title: Re: Rename file on download
Post by: luca69 on February 16, 2009, 05:59:44 PM
:( suppose i have 10000 files or more and i dont know which will be downloaded that can be any na... :( i cant create and save each as ZIP

Sorry, as you wrote "I have to transfer daily 90~100 files" I though you know which files :)

You can create a script to rename all the files when you "publish" them (something like copy *.mp3 *.mp_ ) so that they are not blocked anymore
Title: Re: Rename file on download
Post by: rejetto on February 16, 2009, 05:59:55 PM
i will work on it
Title: Re: Rename file on download
Post by: AYEHAN on February 16, 2009, 07:41:06 PM
no so important but just ...
mm like we are sharing things for nothing ... so what if our site name goes with file name even i know 90% ppls rename the file
Title: Re: Rename file on download
Post by: Mars on February 16, 2009, 09:55:25 PM
Quote
You can create a script to rename all the files when you "publish" them (something like copy *.mp3 *.mp_ ) so that they are not blocked anymore

in your template, have a look at the section [upload-success]

replace all the section with:

Quote
[upload-success]
<li>
{.set|newfilename|{.replace|.oldtxt|.mp3|%item-name%.}.}
{.if not|{.=|%item-name%|{.^newfilename.}.}|{:{.rename|%item-resource%|{.replace|%item-name%|{.^newfilename.}|%item-resource%.}.}:}.}  
<a href='{.replace|%item-name%|{.^newfilename.}|%item-url%.}'>{.^newfilename.}</a>: <b>{.!OK.}</b> --- %item-size%  ({.!Speed.} %speed% KB/s)
{.if| %user% |{: {.append| %folder-resource%\hfs.comments.txt |{.filename|%item-resource%.}=uploaded by %user%
/append.} :}/if.}

all uploaded files with the ext .oldext  are renamed to .mp3 at every upload. you have only to change the .oldext  by your one in the code.
Title: Re: Rename file on download
Post by: gauravforyouall on February 18, 2009, 08:03:31 PM
ahh you got us wrong, solution is for uploading of files ? correct uploading aint in the picture it is just say i have folder abc, in that i ahve files 1.mp3, 2.mp3,3.mp3 i want when i put folder abc on share using hfs it shld so files as 1.anything,2.anything,3.anything to any user viewing or trying to downlaod it. I appreciate your effort for making upload script
Title: Re: Rename file on download
Post by: Mars on February 18, 2009, 08:24:05 PM
the solution you search: when you add a folder abc, you can use a DOS command:

c:\.....\abc>Ren *.mp3 *.anything
Title: Re: Rename file on download
Post by: gauravforyouall on February 18, 2009, 08:31:33 PM
again.... I dont want to rename it on my pc ! Like you can rename a single file virtually in HFS manually by pressing F2 over file i want that task to be automatic. I
Title: Re: Rename file on download
Post by: rejetto on February 19, 2009, 02:49:10 AM
good news for you.
from version 2.3 build #224 you will be able to just put this code in event scripts (ALT+F6)

[download name]
{.replace|.mp3|.mp_|%item-name%.}
Title: Re: Rename file on download
Post by: gauravforyouall on February 20, 2009, 06:48:20 PM
i am waiting !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11  :)
Title: Re: Rename file on download
Post by: maverick on February 20, 2009, 08:57:29 PM
Quote
i am waiting !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11

gauravforyouall show a little respect.  No need to write something like that.  Didn't rejetto's reply above answer your question?
Title: Re: Rename file on download
Post by: rejetto on February 21, 2009, 06:52:42 PM
thank you maverick, but i guess g. was not claiming, but just expressing excitement :)
what he overlooked is that the build was published just 10 minutes after my post, so he waiting for nothing :)