Transfer file from one directory to another

Well. Thank you
So how should I start the action from the button in every record?
And then, being images, can I also resize them?

Create a server connection on the page and set it to “No Auto Load”

image

The from the click action of the button load the Server action with the appropriate parameters like this:

With parameters added specific to that button

Sorry but I’m a little confused
I better explain my need:
1- Each row of the table is relative to a record, which has a field related to the name of a file that is present in a server folder
2- Each line also has a button that should trigger the action
3- The action should load the filename (for the selected record) from the server directory
4- The action should then copy the file to a new directory

So, if I understood correctly, I have to create an action (with GET variable to find the record) and then ??

And on the page when I click on the button, how do I tell it to start the action?

Yes, create a server action with the relevant file information as parameters
Use the file copy server action to copy the file. You an then optionally use the file delete to remove the original copy
From the click event use server connect -> load with the parameters needed (in the event of a table probably loaded from the table data repeat)

I didn’t understand much, but I try

I’m sorry.
I create a connection to the server but I can’t find LOAD like in your example
22

In App connect, Select your button and go to Dynamic Events.You will see the Click event

add the event and then select the data picker

image

You will see the server Connect Load option

Ok but the parameters are different from your example

Marzio,
The parameters depend on what you have defined under GLOBALS > GET in your server action…

True I had forgotten to fix action, I’m stupid
But if the fields containing the filenames are more than one, is it possible to create a multiple action or are there contraindications?

I don’t really understand what you mean. You just pass the file location to your get parameter and then use it in file move/copy step.

Teodor
my requirement is to copy or transfer the images that are currently present in a directory and listed in various records fields of a database, to a new directory / subdirectory
I only need the copy or transfer, because then they are managed by a gallery already created with Wappler
The problem is that the records are many so I would like to assign the action to a button for each record and transfer all the images of the record, but I don’t know if it is possible or if I have to create an action for each field

Well use the create folder step, create it per ID and then use the new folder name in the file copy step.

Ok but I didn’t understand if I can move all the images of the various fields for each record or if I have to do it for every single image

Unfortunately I tried all the ways but I was not able to copy or transfer the images files between directories
I delete the whole procedure and started over again
1- First of all I have create the action and I have configured this:
Can you tell me if everything is correct at this point?
06



47

Marzio

I will put a how to guide together when i get a spare 30 minutes as it is clearly needed.

Moving office to another room this AM so may be later today

Brian

Ok thank You

Hope this helps

2 Likes

I tried to set it up with your instructions, but I haven’t finished yet because I’ve been busy
When I’m done I’ll let you know if it works or not
Thank you

A lot of the video is really just for demo purposes, the important bit for you is how the button works to call the server action and of course the server action itself. I used file Copy so it leaves the original but you could use File Move to move it rather than copy it.