Upload files in different directorys but using the same file to store syspath, name... information

Upload files in different directorys but using the same file to store syspath, name... information

jgcaudetjgcaudet Posts: 82Questions: 7Answers: 0

Hi Allan.

I´m trying this but I don´t achieve it.
I want to upload files in diferent directories depending the option of my app I use.
For example :

uploadedfiles/customers
uploadesfiles/items
uploadesfiles/contracts
.....

I use a unique file named "files" where I store systempath, name .... for all uploaded files.

I upload some files named file01.pdf, file02.pdf,.... from customers option of myapp, so I have in this "files" file :
systempath name
/myapplication/uploadedfiles/customers/file01.pdf file01.pdf
/myapplication/uploadedfiles/customers/file02.pdf file02.pdf
/myapplication/uploadedfiles/customers/file03.pdf file03.pdf
....

When I upload other file named for example file35.xls from my contracts option, when I use dbClean function it delete all entries in "files" for the other directory structure, so I get in files a unique entry :
systempath name
/myapplication/uploadedfiles/contracts/file35.xls file35.xls

So, must I use a different "files" file depending the directory I use to upload the files ??

Thanks

Replies

  • jgcaudetjgcaudet Posts: 82Questions: 7Answers: 0

    I have made some new tests
    It's not a problem with the directorys. I made tests using the same directory in both options of my app and I got the same issue. I can upload some files from the editor of an option of my app (for example customers) and it works fine. But then I change to another option of my app, like contracts, and when I upload the first file it deletes all the files I uploaded from customers and the entries in my table "files"

  • jgcaudetjgcaudet Posts: 82Questions: 7Answers: 0

    I solution this using a distinct file to register uploaded file information for each option in myapp, one for customers, one for contracts.... and so on

  • allanallan Posts: 61,726Questions: 1Answers: 10,109 Site admin

    Yes. The dbClean gets a little messy if you have multiple file types together being updated from the same form into the same table. It is possible using some custom functions, but doing as you have done is the easiest option.

    Regards,
    Allan

This discussion has been closed.