Click here to Skip to main content
15,895,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have admin, where i upload images for package

i need some idea how to work on it..

when i select image , and say upload, what it should do ??? save image in path given on server , and in database ...

or keep in some session or something for time period, and then when i save ,it should upload image on server and save image name in database ...

because , when again , edit package, i should get list of images in that package

pls advice
Posted

1 solution

You can save images in your database, in a separate database, or in the file system. The main thing that putting them in the DB helps with, is making your app easy to move ( all the data is in the DB ) and easy to secure (your code pulls the images out and can choose not to).

Quote:
or keep in some session or something for time period, and then when i save ,it should upload image on server and save image name in database ...


I have no idea what you mean here, but it sounds dumb. Store images permanently, not temporarily. What you're suggesting only makes things harder.

Quote:
because , when again , edit package, i should get list of images in that package


Which means that, where-ever the images are, the database needs to know about them ( by storing details, no matter if the actual image is in the DB or not )
 
Share this answer
 
Comments
maulikshah1990 21-Jan-14 5:06am    
but i have two buttons , one is upload image, and other is save

the upload has to upload image in dir , and save image name in db , and save button will save whole package details in db ....
or u suggest
Christian Graus 21-Jan-14 13:32pm    
Well, in that case, you have no choice but to write it SOMEWHERE, and you can put it in a temp location and store in the session perhaps the fact that it's there. Then you'll need to clear out the temp folder from time to time, where people upload and don't save.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900