Sure, you can program it to do whatever you want. However, in that case I'd just dump the thumbnail.php and have the upload.php return the file name. Then in the uploadSuccess handler instead of calling thumbnail.php and passing the ID you just change it to create the image with the file name.
You'll have to modify the AddImage() function to make that work.
liquidkool Says:
April 30, 2009 - 12:44pm
What would need to change in the AddImage() function. Currently other sections of the script send it image names? Am I missing something?
I really wanted to do some preliminary processing on upload.php and then determine the correct file and display it from thumbnail.php but I can't seem to send the filename back to handler.js. Maybe I need to rethink the workflow.
gyphie Says:
April 30, 2009 - 4:59pm
Page loads
File uploads to upload.php
upload.php creates the thumbnail and stores it in memory (not in a file) with a random key
upload.php returns the random key to the SWFUpload (in uploadSuccess)
SWFUpload takes the random key and calls AddImage(randomKey)
AddImage adds a new image node with the src of "thumbnail.php?id=randomKey"
thumbnail.php takes the random key, finds the thumbnail data in memory and streams the data back to the browser (which loads it in the img node)
What you sound like you want to do is take step 3 and have upload.php save the thumbnail to disk. Then step 4 returns the thumbnail's file name. Then Step 6 needs to be modified to take the file name and instead of creating a new IMG Node with src="thumbnail.php?id=randomKey" to src="filename". Now you don't need thumbnail.php or step 7.
April 30, 2009 - 12:00pm
Sure, you can program it to do whatever you want. However, in that case I'd just dump the thumbnail.php and have the upload.php return the file name. Then in the uploadSuccess handler instead of calling thumbnail.php and passing the ID you just change it to create the image with the file name.
You'll have to modify the AddImage() function to make that work.
April 30, 2009 - 12:44pm
What would need to change in the AddImage() function. Currently other sections of the script send it image names? Am I missing something?
I really wanted to do some preliminary processing on upload.php and then determine the correct file and display it from thumbnail.php but I can't seem to send the filename back to handler.js. Maybe I need to rethink the workflow.
April 30, 2009 - 4:59pm
What you sound like you want to do is take step 3 and have upload.php save the thumbnail to disk. Then step 4 returns the thumbnail's file name. Then Step 6 needs to be modified to take the file name and instead of creating a new IMG Node with src="thumbnail.php?id=randomKey" to src="filename". Now you don't need thumbnail.php or step 7.