View Full Version : Move file/dir after successful action
andreas
05-13-2015, 12:45 PM
Is it possible to make FlashFXP to move all successful uploaded (or downloaded) files to a new directory ?
For example:
I am uploading 10.000 files to an ftp.
After each successful upload I want to move each file to a new path (a remove server) that keeps processed files.
bigstar
05-13-2015, 09:31 PM
Well you could do something like this for upload
Instead of using the normal queue/transfer method you create a custom command and perform it instead.
(There is a bug in the current release that prevents this from working as intended)
You'll need this fix (https://oss.azurewebsites.net/testr/dev-builds/ffxp5.1.0.3840b1.zip), just replace your existing flashfxp.exe with this one.
From the main menu > Commands and then from the Command dialog Add a New Command.
An example is shown below.
/require local
{
/queue "%lp%f"
/set @f@ %f
/switch-activate
{
/enq /move "%rp@f@" "/data/storage/@f@"
}
/switch-activate
}
/switch-activate
/enq /clear cache /data/storage/
/switch-activate
/start
Make sure to replace /data/storage/ with the desired folder you want to move the uploads to.
This script will first check to see if the active browser is local, if not it will abort, queues the first selected file/folder in the local browser and then switch to the remote browser and enqueue a /move operation to move the folder from the target path to /data/storage/<name> switches back to the local browser and repeat until all selected items are queued, then it will switch one final time to remote and enqueue a clear cache on the /data/storage/ folder (just in case its cached) and finally /start will start transferring the queue.
You can omit the /start command or simply add a # in front to comment it out to see what the queue would look like first.
You can also assign this command to a shortcut such as (ctrl+shift+U) if you prefer to use the keyboard.
andreas
05-14-2015, 01:24 AM
1) Instead of defining a specific path, can I assign a relative path.
For example: I want everything to move inside a folder OK where the file is initially located
2) I think there is an issue here:
I downloaded the new version.
I don't know why but I cant save a new command:exclam:
I press the "NewCommand" button > "Upload-Move"
I copy paste the text to the Command field
I assign the "Ctrl+Shift+U" shortcut key.
Apply
OK
When I enter again the menu no command exists.
Keep in mind that is the first command I create/add
bigstar
05-14-2015, 04:40 AM
2) I have fixed the issue saving a new command with the following build (https://oss.azurewebsites.net/testr/dev-builds/ffxp5.1.0.3840b2.zip), the problem occurred if the data file didn't already exist.
1) If I understand correctly, then something like this should work. you should use absolute paths whenever possible.
/enq /move "%rp@f@" "%rpOK/@f@"
andreas
05-14-2015, 05:06 AM
Some more:
- "Esc" is not closing the "Edit Custom Commands" window
- Something bad happens here:
[13:04:49] Upload: dellomsa_5.1.0-5_amd64.deb 79,07 MB in 11 seconds (7,15 MB/s)
[13:04:49] [R] MFMT 20150324152546 /dellomsa_5.1.0-5_amd64.deb
[13:04:49] [R] 213 Modify=20150324152546; /dellomsa_5.1.0-5_amd64.deb
[13:04:49] [R] [CMD] /move "/dellomsa_5.1.0-5_amd64.deb" "/OK/dellomsa_5.1.0-5_amd64.deb"
[13:04:49] [R] RNFR /dellomsa_5.1.0-5_amd64.deb
[13:04:49] [R] 350 File or directory exists, ready for destination name.
[13:04:49] [R] RNTO /OK/dellomsa_5.1.0-5_amd64.deb
[13:04:49] [R] 550 /OK: No such file or directory.
[13:04:49] Move Failure!
[13:04:49] Transferred 1 File (79,07 MB) in 11 seconds (7,03 MB/s)
[13:04:49] Aborted
bigstar
05-14-2015, 07:53 AM
The /OK/ folder must already exist since we're not creating this folder in the script.
Currently ESC does not close the window. I can change this to close when the apply button isn't enabled.
andreas
05-14-2015, 08:11 AM
Bug: All windows on top left corner show the current Flashfxp state.
All except "Preferences" window.
Check Snap1.png
The /OK/ folder must already exist since we're not creating this folder in the script.
The directory does exist
The correct command to be executed on local browser should be:
/enq /move "%lp@f@" "%lpOK\@f@"
The paths created are correct but command remark is to be executed on remote window!!
Currently ESC does not close the window. I can change this to close when the apply button isn't enabled.
Probably if Apply is enabled, it should ask to save or not the changes.
On the other hand, Preferences dialog closes when Esc is pressed even if Apply is enabled
andreas
05-14-2015, 08:37 AM
Check also this log:
Somehow the path is wrongly calculated
[16:30:43] [L] [CMD] /require local
[16:30:43] [L] [CMD] /queue "C:\Users\USER\Desktop\test\dellomsa_5.1.0-5_amd64.deb" This is the correct path
[16:30:43] [L] [CMD] /switch-activate
[16:30:43] [R] [CMD] /enq /move "C:\Users\USER\Documents\dellomsa_5.1.0-5_amd64.deb" "C:\Users\USER\Documents\OK\dellomsa_5.1.0-5_amd64.deb"
[16:30:43] [R] [CMD] /switch-activate
[16:30:43] [L] [CMD] /switch-activate
[16:30:43] [R] [CMD] /switch-activate
[16:30:43] [L] [CMD] /start
[16:30:43] [R] TYPE I
[16:30:43] [R] 200 Type set to I.
[16:30:43] [R] MLST dellomsa_5.1.0-5_amd64.deb
[16:30:43] [R] 550 /dellomsa_5.1.0-5_amd64.deb: No such file.
[16:30:43] [R] TYPE I
[16:30:43] [R] 200 Type set to I.
[16:30:43] [R] PASV
[16:30:43] [R] 227 Entering Passive Mode (10,128,XX,XX,240,190)
[16:30:43] [R] Opening data connection IP: 10.128.XX.XX PORT: 61630
[16:30:43] [R] STOR dellomsa_5.1.0-5_amd64.deb
[16:30:43] [R] 150 Opening BINARY mode data connection for dellomsa_5.1.0-5_amd64.deb.
[16:30:56] [R] 226 Transfer complete. 82.912.228 bytes transferred. 6.645,52 KB/sec.
[16:30:56] Upload: dellomsa_5.1.0-5_amd64.deb 79,07 MB in 12 seconds (6,38 MB/s)
[16:30:56] [R] MFMT 20150324152546 /dellomsa_5.1.0-5_amd64.deb
[16:30:56] [R] 213 Modify=20150324152546; /dellomsa_5.1.0-5_amd64.deb
[16:30:56] [R] [CMD] /move "C:\Users\USER\Documents\dellomsa_5.1.0-5_amd64.deb" "C:\Users\USER\Documents\OK\dellomsa_5.1.0-5_amd64.deb"
[16:30:56] [R] RNFR C:\Users\USER\Documents\dellomsa_5.1.0-5_amd64.deb
[16:30:56] [R] 550 /C/Users/USER/Documents/dellomsa_5.1.0-5_amd64.deb: No such file or directory.
[16:30:56] Move Failure!
[16:30:56] Transferred 1 File (79,07 MB) in 13 seconds (6,31 MB/s)
[16:30:56] Aborted
bigstar
05-14-2015, 10:39 AM
The directory does exist
The correct command to be executed on local browser should be:
/enq /move "%lp@f@" "%lpOK\@f@"
The paths created are correct but command remark is to be executed on remote window!!
Ohhhh I am so sorry by the way you worded your question I thought you wanted to move the target file after upload.
This is much more simplified compared to the original code to move the target after upload.
{
/queue "%p%f"
/enq /move "%p%f" "%pOK/%f"
}
/start
I will respond to you other bug reports and concerns in a follow up post.
andreas
05-14-2015, 11:19 AM
That is working perfectly!! :exclam::2cool::2cool::2cool::surprised:surprised
vBulletin® v3.8.11 Alpha 3, Copyright ©2000-2024, vBulletin Solutions, Inc.