rejetto forum

Rename file on download

0 Members and 1 Guest are viewing this topic.

Offline gauravforyouall

  • Occasional poster
  • *
    • Posts: 12
    • View Profile
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 ...


Offline luca69

  • Occasional poster
  • *
    • Posts: 95
    • View Profile
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 ;)
Life is what happens to you while you are busy making other plans


Offline gauravforyouall

  • Occasional poster
  • *
    • Posts: 12
    • View Profile
:( 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


Offline luca69

  • Occasional poster
  • *
    • Posts: 95
    • View Profile
:( 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
Life is what happens to you while you are busy making other plans


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile

Offline AYEHAN

  • Occasional poster
  • *
    • Posts: 92
    • View Profile
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


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2008
    • View Profile
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.
« Last Edit: February 17, 2009, 02:56:39 PM by mars »


Offline gauravforyouall

  • Occasional poster
  • *
    • Posts: 12
    • View Profile
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


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2008
    • View Profile
the solution you search: when you add a folder abc, you can use a DOS command:

c:\.....\abc>Ren *.mp3 *.anything


Offline gauravforyouall

  • Occasional poster
  • *
    • Posts: 12
    • View Profile
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


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
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%.}


Offline gauravforyouall

  • Occasional poster
  • *
    • Posts: 12
    • View Profile
i am waiting !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11  :)


Offline maverick

  • Tireless poster
  • ****
    • Posts: 1052
  • Computer Solutions
    • View Profile
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?
maverick


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
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 :)