BUG dbClean on FileUpload (many) delete all files
BUG dbClean on FileUpload (many) delete all files
marcoba
Posts: 8Questions: 1Answers: 0
am i wrong or this bug is still here?
https://datatables.net/forums/discussion/39326/deleting-files-while-using-dte-file-upload-many
PS. "An error occurred while moving the uploaded file." is shown when trying to upload something on public example pages for file upload
https://editor.datatables.net/examples/advanced/upload.html
https://editor.datatables.net/examples/advanced/upload-many.html
This discussion has been closed.
Replies
Apologies for the error on the examples - I had a permissions error due to a recent upgrade. Resolved now.
I'm afraid it looks like the Mjoin upload many with db clean is still a problem. I've got it logged to address it for 1.7.3 which I expect to release next week. Thanks for pointing that out!
Allan
I've been digging into this before the 1.7.3 release (a little delayed from when I'd hoped!). There is actually code to allow for this in 1.7.2 - what you need to do is pass information about the table / field which contains the information about the files which are in use to the
dbClean()
method:Outside of the Mjoin it is possible to derive the name of the table and field that should be used for the check to see if a file is in use, but that isn't so easy with an Mjoin, hence the need to specify the table and field as the first parameter to the
dbClean
method.Allan
should we consider this as solved in the relased 1.7.3?
It should actually work in 1.7.2 as well. It didn't require any specific changes in 1.7.3 - you just need to make sure that you pass the table and field name in the first parameter to
dbClean
.Allan
oh ok so we still need to pass the table name in 1.7.3
Thanks
Hello Allan,
I downloaded version 1.7.3.
I was just trying to get to work your code from March 13:
But I am not able to figure it out.
I might be missing something small, but just to be sure, could you provide me with working code example?
The example I gave above will work in the Mjoin upload example.
Could you clarify in what way it isn't working for you? Any error messages? Can you link to a page showing the issue?
Allan
@coderx probably you are specifing the wrong table field: you have to specify the table field that is doing the (multi) record->file_id binding and not the table that is storing all files infos
@marcoba, thank you very much for your comment, exactly this was my problem. I was specifying table storing all files data.
@allan, I apologize, the example you provided, works very well. There was unfortunate naming convention on my side and I did not use pivot table.