is it possible to use uploadMany without Join ?
is it possible to use uploadMany without Join ?

I can't really make it works. It just keep throwing "Array to string conversion in MysqlQuery.php"
The example is using join table, is it possible to not doing this ?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I guess you are referring to this example:
https://editor.datatables.net/examples/advanced/upload-many
Well, you definitely need the join!
What you need is:
- a table holding the references to your files ("file")
- a table holding the logical entity you are saving files for (e.g. "widget", "contract", "tool" whatever it is ...) - and that is the table you are actually editing!
- the link table between the two
Take a look at this thread please:
https://datatables.net/forums/discussion/comment/164076/
Yes, that's what I am referring to.
I mean it's possible to use single upload without join. Can't we just store the the id of the files separated by comma in the database ?
How about this, is there a way to catch the multi uploaded files ids, and submit that instead
Well, you can do anything. But you would need to code it yourself, I guess. Why reinvent something that already exists and works? And it certainly is better data modelling to use the 3 tables as discussed instead of saving a comma separated string with ids ... But that is up to you of course
To confirm my understanding @yokowasis, you want to allow multiple files to be uploaded for a single field, but just to store the ids for the files in a comma separated string (or something) in the host table, rather than needing to use a link / junction table?
Personally I would suggest against doing it that way - use a link table with Mjoin, but if you must do it with a comma separated list of ids, you could use the array formatters on the server-side to chop it into an array (getFormatter) and bring the array from the client-side back into a string on set.
Allan
@allan
Yes that's what I want. I don't know why the method would be different between single and multiple uploads.
In single uploads you just need 1 additional table (table files), contain information such as url, server path, etc. And that's all you need. No join needed.
I tried it your suggestion, but it doesn't work. Any example would be great.
Could you show me what you used please?
Thanks,
Allan
For future user who has the same problem with me, here is the code that works for me
Thanks @allan for the help.
I have no idea why it didn't work before. I delete it, because, well, it didn't work.
Ok, now another problem arise.
I can save and retrieve, but I can't edit.
It says
here is the table json
Probably because there is no id 17 on the files. It seems on upload many, only the first id, is included in the files json.
What version of the server-side libraries are you using please? It does appear to work in this example which is using 1.9.2.
Thanks,
Allan
Okay, I got it to work
Upload Many, no need to use join.