I need some help.
I’m creating an online avatar tool. Basically the interface takes an image on the users local computer, crops it down to a thumbnail, then uploads it.
The problem is that FileReference in Flash won’t let you get the location of the image that is being uploaded. My first thought was to upload the image, then once it’s loaded, open it in flash. I would then be able to crop it and upload the cropped thumbnail. The problem I was having was that updateProgress won’t always tell me when the download is complete (especially for smaller files).
So I guess what I’m asking is a) is there a better way to get the image location? Or b) why isn’t FileReference giving me the proper information?
The flash code I’m using is the “fileUploader” example that is on this site. The php code I’m using is this:
<?php
if(($_FILES[‘Filedata’][‘type’] == ‘image/jpeg’)
|| ($_FILES[‘Filedata’][‘type’] == ‘image/pjpeg’)
|| ($_FILES[“file”][“type”] == “image/gif”)
|| ($_FILES[‘Filedata’][‘size’] < 200000 ))// 200KB
{
$filename = $_GET[‘filename’];
move_uploaded_file($_FILES[‘Filedata’][‘tmp_name’], ‘upload/’ . $filename);
}
?>