I am running Photopost software, and recently, SWF was integrated to handle the uploads. With the basic Application demo, I do not have it set to show the thumbs after upload completed. Where and what do I add into the script file to handle this?
How you display thumbnails all depends on your application. There isn't a lot we can tell you.
In the Application Demo it works like this:
1) file uploaded
2) file received by upload.php
3) upload.php reads the file from the temp location where PHP stores it
4) upload.php creates a thumbnail
5) upload.php outputs the thumbnail to the buffer but then captures the buffer into a variable. This way we never have to save any files (which is what we want for the demos but in real applications you'd probably never do it this way).
6) upload.php creates a big random string (BRS)and stores the thumbnail data in the session using the BRS as the key.
7) upload.php outputs the BRS back to the client (SWFUpload)
8) SWFUpload receives the BRS in uploadSuccess(file, serverData)
9) SWFUpload creates a new <img> tag with thumbnail.php as the SRC passing the BRS on the query string.
10) thumbnail.php gets the BRS, retrieves the thumbnail data from the session and outputs it (dynamically generating the image requested by the <IMG> tag.
That whole process it kind of dumb because you wouldn't do it that way in a real application. You'd probably save the thumbnail image to the disk and just return the URL to SWFUpload and load the thumbnail directly. Or you'd store the thumbnail in the database and return an ID to SWFUpload and have thumbnail.php load the thumbnail from the database. You'd probably not muck around so much with the session. But for the purposes of the demos we don't want to save your test files so we just use the session or completely ignore the file.
You'll have to figure out how to make things work in your application. It takes a big of server side and client side programming to make it all work together.
wel, the application I use it on does not process the images until the next step. So I wold think your version would work best for it... I will play around with it..
After closer review - the software I have has the simple uploader integrated. Including the thumbnail issue is a bit more complicated than just adding some code. I will look into it further, when I have a bit more time.
Can't really help
How you display thumbnails all depends on your application. There isn't a lot we can tell you.
In the Application Demo it works like this:
1) file uploaded
2) file received by upload.php
3) upload.php reads the file from the temp location where PHP stores it
4) upload.php creates a thumbnail
5) upload.php outputs the thumbnail to the buffer but then captures the buffer into a variable. This way we never have to save any files (which is what we want for the demos but in real applications you'd probably never do it this way).
6) upload.php creates a big random string (BRS)and stores the thumbnail data in the session using the BRS as the key.
7) upload.php outputs the BRS back to the client (SWFUpload)
8) SWFUpload receives the BRS in uploadSuccess(file, serverData)
9) SWFUpload creates a new <img> tag with thumbnail.php as the SRC passing the BRS on the query string.
10) thumbnail.php gets the BRS, retrieves the thumbnail data from the session and outputs it (dynamically generating the image requested by the <IMG> tag.
That whole process it kind of dumb because you wouldn't do it that way in a real application. You'd probably save the thumbnail image to the disk and just return the URL to SWFUpload and load the thumbnail directly. Or you'd store the thumbnail in the database and return an ID to SWFUpload and have thumbnail.php load the thumbnail from the database. You'd probably not muck around so much with the session. But for the purposes of the demos we don't want to save your test files so we just use the session or completely ignore the file.
You'll have to figure out how to make things work in your application. It takes a big of server side and client side programming to make it all work together.
wel, the application I use
wel, the application I use it on does not process the images until the next step. So I wold think your version would work best for it... I will play around with it..
After closer review - the
After closer review - the software I have has the simple uploader integrated. Including the thumbnail issue is a bit more complicated than just adding some code. I will look into it further, when I have a bit more time.
where is the temp location
where is the temp location where php usually stores it?