4
Contributors
7
Replies
37
Views
4 Years
Discussion Span
Last Post by gogs85
0

Create a single insert query. It may time-out though. Depends also on how you are accessing your images, and how you want to store them.

0

storing image in db is not recommended as you will be storing it in BLOB(Binary large object) datatype.So for storing it in Database it will be encoded in binary format and saved and will retrieving it will again decode.As you have so many files,it will be better you store it in some folder location and store the location with filename in Database.

0

i want to store image myself before i put my website online and then user make download from my site.If i store image filename for all image that is be long day..

0

no it is not required to be done manually.you can write a script to store,filename and your hardcoded location where all images will be and file type in db,copy all images to that location.
So table will be something like this.

FileIId INt not null auto_increment
FileName varchar(50) not null
FileType varchar(50) not null
FileLocation varchar(50) not null

Edited by IIM

0

your are stating the multiple file uploads right?

well there are some samples of multiple file uploads at one just like facebook. I don't know how to move this thread to Javascript section, but perhaps it will be the same and will pass down to PHP script for storing it to the database.

Things to consider.
Java script is the one who handles multiple file uploads at the browser view. for example, on the default script of html tag's input type file, it only handles one file at a time, to make it multiple selected, it needs Javascripting for that input type file tag by using either getElementByID or the name of the tag it self. make sure that the name attribute of the input type file has square brackets just like below:

<input type='file' name='myFiles[]' ID='myfiles'>
it will come in handy when your name attribute will be looking like a structure of an array at the html level. because this will help Java script to handle the files more quickier than easier.

Java script Level
create some sort of a function that you want in Java script level for enabling GUI upload window to handle more than one file at the UPLOAD files window. Do it on your own the way you want it. additionally, if you want some restrictions of which file type and how heavy the file should be at per element of the array. In this manner it will help PHP to make transactions more quickier and make the computation of PHP less time consuming.

PHP Level
Do not store the files in your database directly for much more easier to handle the database. use also $_FILES function in PHP to handle the name of the file, the capacity of the file and the file type of the file. Mostlikely, getting the file type and the file capacity is now available also on Java script. the only thing that you should store in the database is the result of $_FILES per element of an array not the file it self. If you store the files it self directly to the database, then your making your own a site that is not user friendly and it will be a pain in the ass, because it will be time consumable.

Edited by masterjiraya

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.