Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
in Plugins by
Allows users to upload their images to the web server.

Q2A version: 1.7.3
upload images as in a image gallery for Users ?
No. The reason behind this plugin is to give you the option of saving users avatars in the database and uploaded images to a folder on the server. By default you have to save both avatars and uploaded images to the database or a folder on the server. You can't do both.

2 Answers

+1 vote
edited by
Very good tool.
Do you think you can do it by user profile?
As each user changes his avatar and would be a good photographic record

I run the test in agora.oo.gd

Thank you for your contribution
The only problem is that anyone can upload an image not grateful
And maybe upload some Trojan in image ... is the only thing I see
You could lock the form down to user level and user profile like so....

function output_widget() {
$fromhandle = qa_get_logged_in_handle();
$fromhandlehandles = array('user1', 'user2');
if ( qa_get_logged_in_level() >= QA_USER_LEVEL_EXPERT || in_array($fromhandle, $fromhandlehandles) ) {
echo "<form action='/qa-uploads/upload.php' target='_blank' method='post' enctype='multipart/form-data'>";
echo "Select image to upload:";
echo "<input type='file' name='fileToUpload' id='fileToUpload'>";
echo "<input type='submit' value='Upload Image' name='submit'>";
echo "<br><br>";
echo "File size limit is 2MB.";
echo "<br><br>";
echo "Only .jpg, .jpeg, .png , .gif, .JPG, .JPEG, .PNG & .GIF files are allowed.";
echo "<br><br>";
echo "<a href='/upload-image-tutorial/' target='_blank'>Upload Image Tutorial</a>";
echo "<br><br><hr><br>";
echo "</form>";
echo "Uploaded images - Click on a link below:<br><br>";
$dir = "qa-uploads/uploads/";
$exclude = array( ".","..","error_log","_notes" );
if (is_dir($dir)) {
    $files = scandir($dir);
    $filecount = count( $files );
    echo "Number of images uploaded: $filecount in alphabetical order below<br><br>";
    foreach($files as $file){
        echo "<a href='/qa-uploads/uploads/$file' target='_blank'>$file</a><br>";
        echo "<br><br><hr><br>";
Where I hit that code or where I replaced it.intent but I do not change
i  was put it in q2a-uĀ“ploadimage.php but not work
I've updated the code in Github.
Awesome you got it

Thanks for your contribution is excellent.


You think that the profile images can accept the code so that they are gif or movement. This would make a change in trend by observing the profile image of a user as it would be animated
+1 vote
Nice plugin, but hope users will not take advantage and upload any stuff on site.
Works and has privacy
Good! You are developing small and very useful plugins. Keep up good work!