Multiple file upload for gallery using asp.net mvc 5 code first RRS feed

  • Question

  • User-471420332 posted

    I did not use multiple file upload in my mvc code first using linq, i have below requirement for adding gallery


    I need to insert data like below on submision in my below table structure. ThumbImage will same for one gallery submission and ImageName is multiple file data will store and  i have two files for multiple upload like DSC_3777_3152018.jpg and DSC_3738.jpg and passing eventid random value for one galelry.

    Sno                                ImageName                        ThumbImage                         EventId                           EventDate
    1                                DSC_3777_3152018.jpg         DSC_3777_3152018.jpg           1111                           2018-05-31 12:32:50.730
    2                                DSC_3738.jpg                         DSC_3777_3152018.jpg           1111                          2018-05-31 12:32:50.730

    Thank you very much in advance

    Tuesday, October 23, 2018 7:48 AM

All replies

  • User753101303 posted


    And the question is ? It seems you are looking for http://techfunda.com/howto/282/upload-multiple-files-on-server and you would have just one fileSingle control with a fileMultiple control using the multiple attribute.

    If having a single thumbinal I would not use this db design (the thumbnail would be part of a Gallery table and you have a table holding a row for each image).

    If you need further help please don't stop at telling us what you want to do. Tell us what is the first problem when trying to do that so that we can focus on what you need (and don't waste time on trying to explain what you know how to do).

    Edit: System.Random could perhaps help what won't be unique ? This is an id or an order ? Also it seems you are usiing the client side file name which can cause collitions. I prefer to keep the original name in my db and name them myself in my server side storage.

    Tuesday, October 23, 2018 11:16 AM