rejetto forum

How do you move a file to a new folder only after upload is complete?

Guest · 43 · 10213

0 Members and 1 Guest are viewing this topic.

Henry

  • Guest
I'm setting up an automated Flash video conversion workstation.  Here's how it works:

1) user logs into HFS and uploads quicktime file to real folder on HFS machine.
2) on HFS machine, sorenson squeeze is watching the folder, and automatically converts the file and places it in my Wowza content folder
3) Wowza streams to fast start Flash player embedded in our web site

HOWEVER

Sorenson Squeeze wants to start converting IMMEDIATELY when it senses a quicktime file in the folder it's watching.  Thusly, it will begin to convert the quicktime before the file is done uploading, and subsequently fails.

Is there a way to enable completion moving so that i can upload to a different real folder, then have HFS automatically move the file to the Squeeze watched folder when the upload is complete?

Thanks in advance!

Henry


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
yes, but you will need HFS 2.3 (currently in beta)

just add this event script (ALT+F6)

[+upload completed]
{.move|%item-resource%|C:\another_folder\%item-name%.}


clearly you don't need to publish "another folder" in any way.
untested!


Offline Caco

  • Tireless poster
  • ****
    • Posts: 113
    • View Profile
How can i run external app on upload completion?

I would like to encode uploaded files with mencoder, like this:

hfs.events

[+upload complete]

mencoder.exe %item-folder%%item-name% -o %item-folder%/[previews]/%item-name%.flv -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
[+upload completed]
{.exec|mencoder.exe %item-resource% -o   etc etc etc.}


Offline Caco

  • Tireless poster
  • ****
    • Posts: 113
    • View Profile
Hi Rejetto, thank you for your sudden reply!  :)

I tried in many ways, but it didn't work.

Where should i put the file "mencoder.exe"?


Offline Caco

  • Tireless poster
  • ****
    • Posts: 113
    • View Profile
I even tried this:


[+upload completed]
{.move|%item-resource%|C:\another_folder\%item-name%.}


but nothing happened. It seems that my hfs #238 is ignoring my scripts at all  ???

I have macros enabled in my hfs config.





Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
Where should i put the file "mencoder.exe"?

you can keep it where it is, and specify the path
{.exec|C:\folder\mencoder.exe etcetc.}

or you can move mencoder to the hfs.exe folder
or you can move it to any folder specified in your "path" enviroment variable. [more]

[+upload completed]
{.move|%item-resource%|C:\another_folder\%item-name%.}
but nothing happened. It seems that my hfs #238 is ignoring my scripts at all  ???

whoops! this is a bug in HFS.
the file is still locked when "upload completed" is run, so it cannot be moved.
i will fix this problem for next release!


Offline Caco

  • Tireless poster
  • ****
    • Posts: 113
    • View Profile
Yes, i've already set up hfs folder in my PATH variable.

I put notepad.exe in my C:\ folder, and set up hfs.events to launch it each time upload is completed:

[+upload completed]
{.exec|C:\notepad.exe.}

or

[+upload completed]
{.exec|C:\notepad.exe|document.txt.}

nothing happens :(



Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
whoops, that's another bug :D
{.exec.} has been actually broken in version #232 when i introduced optional parameter "out".
at the moment it is not working without this optional parameters. it's like it is not truly "optional" :D
i will fix this bug too in next release.
i hope to publish it tomorrow!

in the while, you can use this version. it should work.
{.exec|C:\notepad.exe|\boot.ini|out=xxx.}


you can post in the italian forum if you like ;)


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2005
    • View Profile
Quote
i will fix this bug too in next release.
i hope to publish it tomorrow!

un avant goût par mail comme d'hab ;)


Offline Caco

  • Tireless poster
  • ****
    • Posts: 113
    • View Profile
Quote
whoops, that's another bug  :D

LOL  ;D

Quote
{.exec.} has been actually broken in version #232 when i introduced optional parameter "out".
at the moment it is not working without this optional parameters. it's like it is not truly "optional" :D

I didn't find in the docs a detailed description of {.exec.}, it would be helpful for me  ;)

Quote
i will fix this bug too in next release.
i hope to publish it tomorrow!

Great news, i'll wait for the next release,then ;)

Quote
you can post in the italian forum if you like ;)

Yes, thank you, i posted here (despite of my bad english) cause this could be helpful for Henry and for other non-italian users ;)





Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
I didn't find in the docs a detailed description of {.exec.}, it would be helpful for me  ;)

except the "out" parameter, that i'm about to add, what would you want to read there?


Offline Caco

  • Tireless poster
  • ****
    • Posts: 113
    • View Profile
Well, if some function has parameters, a brief description of each of them and a little example of its usage...  :P


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
at the moment every function is documented, and only 2 parameters were not documented.
now that i did it for the "out", only 1 parameter has left.
it's few months that i put examples in the docs, so only most recent functions have an example.
please, if you read the docs, report every command that you think it's not documented enough. we'll try to improve.


Offline Caco

  • Tireless poster
  • ****
    • Posts: 113
    • View Profile
Well, notepad.exe is an easy task to verify that .exec is working, the final goal is to pass a complex string to mencoder  :D

However

[+upload completed]
{.exec|C:\notepad.exe|\boot.ini|out=xxx.}

still doesn't work for me.  :(

How about build #239?  :D