newxtensio form and force update uploaded file?

piripacchio
Posts: 37
Joined: 2010-04-28 08:34

newxtensio form and force update uploaded file?

Post by piripacchio » 2010-05-18 09:21

Hi all,
I have a nextensio form that enable file upload/download and works on a file table.

All file are uploaded on the user folder. The user folder is created based on the userID session variable when logged in.

The admin user can see all file uploaded by all users. And can edit them.
The admin can change the user field on a file record.
But when you edit a file record changing only the user field, no update on the file field will take place, since you didn't change the file field. So, the file is orphaned on the previous user folder.

I would like to update the file field even when the file field is not changed. How can I do this?

TIA

tony

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: newxtensio form and force update uploaded file?

Post by Fred » 2010-05-19 09:04

I would add a tick-box somewhere on the form that can be ticked if the files needs to be moved.

Upon updating the file have your script check if the box is ticked and if so send the page to a different page where you can use the php rename() function.

It is primarily a rename function but here is examples of how to use it to move a file as well
http://fr2.php.net/manual/en/function.rename.php

Hope it points you in the right direction.

Post Reply