Jump to content

Image Upload?


liamloveslearning

Recommended Posts

Hey all,

 

I'm just figuring out how to allow users to upload images to there own "portfolio" so be it on my website;

I'm just curious however as to where to store my images; id like to store them on my host in a folder as opposed to in the mysql db itself but all I've come across online is uploading images to the mysql table, (I'm not sure if this is possible so excuse my naivety  ???)

 

Is this possible and does anyone have any ideas as to where I should start? thanks :)

 

 

Link to comment
https://forums.phpfreaks.com/topic/117935-image-upload/
Share on other sites

I don't have time to give code examples in regards to uploading files

But in the MySQL vs File System storage

 

In my opinion binary data like file contents should NOT belong in an SQL database

Instead it should be on the file system

If it needs to have special access permissions, they should be stored outside of the wwwroot and instead have a script load the file data and output to the browser.

Link to comment
https://forums.phpfreaks.com/topic/117935-image-upload/#findComment-606630
Share on other sites

Yep, that makes sense, it wont really matter where the files are stored in that case.

Don't get caught up in the hype of storing file binary data in databases, in most general cases it is not necessary.

To begin, look into the move_uploaded_file() function and that should give you a lot of hints and tips to start a basic upload script.

I'm sure others here can share some wisdom

Link to comment
https://forums.phpfreaks.com/topic/117935-image-upload/#findComment-606642
Share on other sites

hey everyone, im still having trouble finding what i need online,

I assume ill need a table called "user_portfolio" or whatever which contains the fields user_id, img_id, and then a column for the image itself; i also want to be able to send up multiple files for each user, like that on social profiles where you can upload x amount for everyone to see;

 

does anybody have any idea where I'd find how to do this, or just confirm what im thinking with the mysql side of this is correct? thanks

Link to comment
https://forums.phpfreaks.com/topic/117935-image-upload/#findComment-606728
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.