show uploaded images

show uploaded images

Postby mogmog » Wed Sep 16, 2009 8:10 pm

Hello.

I have a question how can i show all uploaded images at the multi upload?

Is it posible to show direktly the images they are complet uploated. :D
in a spechal div case? like dies:
Code: Select all
<div id="complete"><img scr="uploadet_image.jpg"><div>
mogmog
 
Posts: 5
Joined: Wed Sep 16, 2009 8:02 pm

Re: show uploaded images

Postby mogmog » Thu Sep 17, 2009 11:19 am

Hey Ihave en ideer,

i yuse JSON for file requests howe is it posible refresh the json when an upload is ready?
there ist the code:
Code: Select all
$(document).ready(function() {
   $("#fileUpload").fileUpload({
      'uploader': 'upload/uploader.swf',
      'cancelImg': 'upload/loeschen.png',
      'script': 'upload/upload.php',
      'folder': 'files',
      'fileDesc': 'Image Files',
      'fileExt': '*.jpg;*.jpeg',
      'multi': true,
      'auto': true,
      'displayData': 'speed'
   });

    $.getJSON("upload/upload.php",
         function(data){
           $.each(data.items, function(i,item){
            $("<img/>").attr("src", item.media.m).appendTo("#images");

            if ( i == 3 ) return false;
           });
         });
});


afte the upload ther ride the files in to the Database i neede the database datas

can anybudy help me?
mogmog
 
Posts: 5
Joined: Wed Sep 16, 2009 8:02 pm

Re: show uploaded images

Postby iStan » Thu Sep 17, 2009 12:16 pm

I have difficulties to understand your English.

So what I understand is, after a file is upload you would like to trigger something so the image appears almost immediately after the upload somewhere on your page.

You can use the events onComplete and onAllComplete, check the manual for more information.
What you could do is with the onComplete event, save the filename to a hiddenfield, and simulate a buttonclick (that button can be made hidden) something like $('hiddenbutton_getImage').click();

So now you need to have to wire up a click event on this hidden button to magically access the database and refreshes that part of your page that will display the hidden image.

If you upload more than 1 file at the time you need to consider another way to store the filename, for example an array. And trigger a javascript ajax request.

I hope my explanation is helpful.
User avatar
iStan
 
Posts: 116
Joined: Mon Aug 24, 2009 12:57 pm
Location: Alicante, Spain

Re: show uploaded images

Postby mogmog » Thu Sep 17, 2009 2:57 pm

Hy,

Sorry my englich is not verry well when write somthing,

what you understand is right.
jes I wont to yous the multi upload how can i trigger a javascript ajax request. I know to create an array on php but not in javascript. :roll:
mogmog
 
Posts: 5
Joined: Wed Sep 16, 2009 8:02 pm

Re: show uploaded images

Postby RonnieSan » Fri Sep 18, 2009 3:57 pm

First, edit the PHP file so it echoes the URL of the uploaded file on the server.
Next, create the div you want display the thumbnail in.

Code: Select all
<div id="thumbnails"></div>


Then, add this to the options of your uploadify script:

Code: Select all
onComplete : function(event,queueID,fileObj,response,data) {
  $('#thumbnails).append('<img src="' + response + '" />');
}


You can of course edit to fit your needs. I haven't tested this but it should work.
RonnieSan
The father of Uploadify...
RonnieSan
Site Admin
 
Posts: 66
Joined: Sat Mar 07, 2009 12:29 am

Re: show uploaded images

Postby cthamer » Tue Sep 22, 2009 8:43 pm

Ronnie,

Your code worked perfectly. I should point out to others to remember to modify uploadify.php as mentioned in the post. I missed that my first time around.

This is the code you need to echo in uploadify.php

echo $_REQUEST['folder'] . '/' . $_FILES['Filedata']['name'];
cthamer
 
Posts: 1
Joined: Tue Sep 22, 2009 8:40 pm

Re: show uploaded images

Postby wenlean » Thu Jul 29, 2010 5:51 am

cthamer/ronnie,

i followed the steps above but still it doesn't work for me. could you please paste the complete code or if you know a tutorial for this please share it with us.

thank you for your responses to this wonderful topic, hope to learn more from you guys.

thanks.

wenlean
wenlean
 
Posts: 2
Joined: Thu Jul 29, 2010 3:29 am

good !

Postby stuv941 » Sun Sep 05, 2010 6:32 am

stuv941
 
Posts: 6
Joined: Mon Jul 05, 2010 1:31 am


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 5 guests