Jump to content

Image upload system moderation method


angelali

Recommended Posts

Hello, my friends and I are planning to make a photo gallery, where people can upload their images and everyone can view them. These images will be saved in database. The problem is, we have to moderate these images when uploaded, to prevent adult content or copyrighted images from being displayed.

 

We were thinking to make people send us these images by email, I mean through an email attachment, then we will review them, and if these images are OK, we will insert them manually into the database. We want as far as possible to not consume unnecessary spaces in the database, else the hosting will cancel our account even it offers unlimited space and bandwidth. We could make these images store in a folder, but the persons will have to give their names, that's why we think it would be better to make them fill some fields, attach the image and send us by email.

 

1/ Do you think this method is good? If you have another method, please give me...

 

2/ And also how do you insert images manually to database? I'm using PHPMyAdmin. I mean, to upload an image which is on my computer itself. I know there are some MySQL IDEs which do this, but do not know on PHPMyAdmin

 

 

Thank you

Link to comment
Share on other sites

Perhaps let the "REGISTERED" users upload the pics via form. db table id, image_name, user_id, approved. set approved to 0 for NOT approved yet. When user uploads pic, move to folder, add to db, send email to Admin that image has been uploaded. THEN when Admin reviews the unapproved images she/he can either delete the image or change approved to 1. When displaying the pics, set filter to only show pics where approved = 1.

 

 

Link to comment
Share on other sites

You should save images in the file system, and only save the file name and location in the database.

 

You could also allow them to upload the image, and have a web interface for your admins to approve/reject. Rejected ones get deleted from filesystem and DB. Approved ones get a flag to be shown on the site.

Link to comment
Share on other sites

Move the images to a folder, but, if an image has the same name, how will I know? as if i store the images in folder, only the image will be stored... And secondly, how to add images manually in database if you know please...on PHPMyAdmin.. thank

Link to comment
Share on other sites

Typically you would append something to the name to make it unique, such as the time().

 

AFAIK you cannot put images into a database using phpMyAdmin, which is a good thing. Images should not be stored in a DB.

Link to comment
Share on other sites

Well, well, well, I have to choose a real solution, me too I didnt  want to store database in DB....but I think I have to, as people can search these images, there will be also categories of images like Technology, Abstract etc...  :shrug:

Link to comment
Share on other sites

In fact myself I would not be able to determine if an image is copyrighted or not, so my conditions will be clear on the site, I am not responsible if the person has uploaded a copyrighted image...but for adult content, I should moderate...

Link to comment
Share on other sites

In fact myself I would not be able to determine if an image is copyrighted or not, so my conditions will be clear on the site, I am not responsible if the person has uploaded a copyrighted image...but for adult content, I should moderate...

 

Wonder how Kim Dotcom would respond to that?  I'm sure you'll be enough under the radar that it won't matter.

 

But ya, scratch the idea of receiving images via email and having to insert manually and do as was suggested with a backend control panel where images can be moderated more efficiently.

 

As for filenames, I generally hash the filename with time():

 

$filename = md5($_POST['image'] . time());

 

So as to avoid improper filenames (unwanted wording, spaces in filename, etc).  Then just store that in a table.

 

Also, you can, but is not entirely necessary (all depending on expected growth of site and knowledge of file/directory handling), create folders for each user and store their images in there (assuming a user must be registered to upload an image).  But hashing will suffice, I'm sure.

 

Never store the path of the file in the table.  Simply the filename, as directories/folders can be changed over time, and you don't want to have to update every file in the table.

Link to comment
Share on other sites

Oh no, now you are making me afraid when you mentioned Megaupload's owner..  :'(

 

Well, if like this, we will decide if we are going to cancel the project of image hosting and gallery...or simply, we can make a simple website where user will just upload an image, store it in the folder like a boss :D and give the user his links, embed codes etc...

 

But wait, what to create in the place of the image website if it is going to cancel?  :shrug: Ok, we will think of a website directory...  :D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.