⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Upload multiple files



papichulomx

papichulomx
  • profile picture
  • Member

Posted 23 January 2012 - 01:06 AM

Hi everybody,

I have question about something that I'm trying to do; I have a table with some text fields, but also I want to upload 1 or more files (images) related to that record and save that files names in other table. At this moment, if I want to upload more than 1 file, I have to add more fields to the table, and that's what I don't need.

I was wondering if is this possible to do. Or if there is another way to do it.

This is an example of what I'm trying to do:

[b]Table 1 (Content)[/b]

- Id_content
- Title
- Content
- Date

[b]Table 2 (images)[/b]

- id_file
- Id_content
- file_name


Thanks for you help.

xxaxxo

xxaxxo
  • profile picture
  • Member

Posted 23 January 2012 - 05:20 AM

if you don't want to code it yourself , you can use the "relation" to "link" the file_id from the tables, that way you can have multiple images in the second table related to single id from the first.

christian1988

christian1988
  • profile picture
  • Member

Posted 11 February 2012 - 15:45 PM

[quote name='xxaxxo' timestamp='1327296038' post='324']
if you don't want to code it yourself , you can use the "relation" to "link" the file_id from the tables, that way you can have multiple images in the second table related to single id from the first.
[/quote]

can you post an example?

xxaxxo

xxaxxo
  • profile picture
  • Member

Posted 11 February 2012 - 15:59 PM

well it's as simple as that http://www.grocerycrud.com/crud/example/set_a_relation - just imagine that the employee's table is your table_1 and the offices is your table_2, and officeCode is your id_content

christian1988

christian1988
  • profile picture
  • Member

Posted 11 February 2012 - 22:45 PM

[quote name='xxaxxo' timestamp='1328975984' post='489']
well it's as simple as that http://www.grocerycr.../set_a_relation - just imagine that the employee's table is your table_1 and the offices is your table_2, and officeCode is your id_content
[/quote]

ok, but what if i need to insert into the second table?

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 12 February 2012 - 12:41 PM

I look at your tables and there are sometimes that grocery CRUD doesn't fit to your needs.

For now you cannot add to the relation a new record straight away. This is a feature that I will try to have in future versions, as many users asked for (imagine a button "add +" at the right of the set_relation field). But even if I had this type of feature, you need actually a let's named it "photo gallery" CRUD that has this feature. Even if everything goes well, I think the customer don't like to have in table interface their images. So perhaps you have to create a custom photo gallery with an interface like this: [attachment=47:2012-02-12_123638.png]

This is just my opinion.

or12

or12
  • profile picture
  • Member

Posted 02 November 2012 - 08:13 AM

yes the same thing i want to add over my project, can you please help me how can i user http://www.grocerycrud.com/image-crud over a single id or such as popup or any other thing so that we can combine it to make it more better use in multiple file upload

voghDev

voghDev
  • profile picture
  • Member

Posted 03 June 2014 - 10:54 AM

Any news in that aspect??

 

I have a similar case:

 

/topic/2612-entity-with-1n-uploaded-images/


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 03 June 2014 - 15:21 PM

If you want to upload just file... u can use this /topic/1912-updated-30072013-multiple-uploading/

 

this is useful ...

u can alter the same for adding name / content as u wish to .. and get your solution served.

 

Hope this helps u

 

 

Happy GCing :)