Also create write permissions need to be on for PHP. Generally PHP will =
have those permissions but creating a test PHP script that creates and =
writes to a file. Test that first without Flash.=20
--=20
Lon Hosford
www.lonhosford.com May many happy bits flow your way!
[quoted text, click to view] "DrEv1l" <webforumsuser@macromedia.com> wrote in message =
news:dr6efj$du5$1@forums.macromedia.com...
although the output says all done in the onComplete I have no file in =
mij=20
directory.
this is my php
<?
if ($_FILES['Filedata']['name']) {
$uploadDir =3D "images/";
$uploadFile =3D $uploadDir . basename($_FILES['Filedata']['name']);
move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploadFile);
}
?>
//import the FileReference Object
_global.path =3D "http://localhost/merch";
import flash.net.FileReference;
//initial settings
uploadFile_mc.enabled =3D false;
//the FileReference object
var file_fr:FileReference =3D new FileReference();
//object for listening to for FileReference events
var list_obj:Object =3D new Object();
list_obj.onSelect =3D function() {
if (file_fr.size/1024<150) {
uploadFile_mc.enabled =3D true;
name_txt.text =3D file_fr.name;
} else {
name_txt.text =3D "max 150kb.";
uploadFile_mc.enabled =3D false
}
};
list_obj.onComplete =3D function() {
name_txt.text =3D "All Done";
rec_mc.clear();
uploadFile_mc.enabled =3D false;
};
list_obj.onProgress =3D function(bytesTotal, bytesLoaded) {
var percent =3D bytesLoaded/file_fr.size;
drawRec(percent);
};
//if a user selects cancel
list_obj.onCancel =3D function() {
name_txt.text =3D "Cancel was selected";
};
//if there is an IO error
list_obj.onIOError =3D function(fileRef) {
name_txt.text =3D "IO error with "+fileRef.name;
};
//security error problem
list_obj.onSecurityError =3D function(fileRef, error) {
name_txt.text =3D "Security error with "+fileRef.name+":"+error;
};
//httpError
list_obj.onHTTPError =3D function(fileRef:FileReference, error:Number) =
{
name_txt.text +=3D "HTTP error: with "+fileRef.name+":error #"+error;
};
//attach the listener
file_fr.addListener(list_obj);
//the event for the browse button
browse_mc.onRelease =3D function() {
file_fr.browse([{description:"Images",=20
extension:"*.JPG;*.jpg;*.psd;*.gif;*.png"}]);
};
//the event for the upload button
uploadFile_mc.onRelease =3D function() {
file_fr.upload(path+"/_php/upload.php");//?naam=3D"+file_fr.name
rec_mc.fillColor =3D Math.random()*0x1000000;
};
//drawing the rectangle
function drawRec(per) {
rec_mc.clear();
rec_mc.lineStyle(0);
rec_mc.beginFill(rec_mc.fillColor, 70);
rec_mc.lineTo(per*rec_mc._width, 0);
rec_mc.lineTo(per*rec_mc._width, rec_mc._height);
rec_mc.lineTo(0, 30);
rec_mc.lineTo(0, 0);
rec_mc.endFill();