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

https://github.com/bluegenel/q2a-uploadimage
Q2A version: 1.7.3
by
upload images as in a image gallery for Users ?
by
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
by
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
by
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
by
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);
    natcasesort($files);
    $filecount = count( $files );
    echo "Number of images uploaded: $filecount in alphabetical order below<br><br>";
    foreach($files as $file){
        if(!in_array($file,$exclude)){
        echo "<a href='/qa-uploads/uploads/$file' target='_blank'>$file</a><br>";
        }
}
        echo "<br><br><hr><br>";
        }
}
}
by
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
by
+1
I've updated the code in Github.
by
Awesome you got it

Thanks for your contribution is excellent.

now....


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
by
Nice plugin, but hope users will not take advantage and upload any stuff on site.
by
Works and has privacy
by
Good! You are developing small and very useful plugins. Keep up good work!
...