MySQL interesse |
|
Ik heb een probleem met mijn 'flashuploader' . Ik wil dat mijn map structuur dynamisch is alleen wil dit echter niet werken.
Map structuur: /bestanden/$gebruikersnaam/$module/$categorie/
$theUploadFolder = 'upload' ; moet dus bijvoorbeeld worden:
$theUploadFolder = $_GET["map"];
Alleen kan ik deze echter niet uitlezen in mijn upload.php , ik heb dit ook al geprobeerd met $_SESSION.
Ik ben nieuw met AS maar daarin stond het volgende:
function uploadImages() {
upwin.alphaTo = 100;
browseBtn.enabled = false;
totalErrors = 0;
totalBytesLoaded = 0;
previousBytesLoaded = 0;
for (i in tableDetails) {
allImages.fileList[i].upload('upload.php');
listener[i] = new Object();
listener[i].previousBytesLoaded = 0;
///
listener[i].onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
newBytesLoaded = bytesLoaded-this.previousBytesLoaded;
totalBytesLoaded += newBytesLoaded;
percentage = Math.round(totalBytesLoaded/totalFileSize*100);
a = 2.9*percentage;
upwin.pw = a;
if (percentage == 100) {
setInterval(nextPage,1000);
}
this.previousBytesLoaded = bytesLoaded;
};
//Possible file upload errors
listener[i].onHTTPError = function(file:FileReference, httpError:Number):Void {
file.cancel();
totalErrors += 1;
};
listener[i].onIOError = function(file:FileReference):Void {
file.cancel();
totalErrors += 1;
};
listener[i].onSecurityError = function(file:FileReference, errorString:String):Void {
file.cancel();
totalErrors += 1;
};
if(totalErrors > 0){
upwin.alphaTo = 0;
errorField.text = uploadErrorText;
}
///
allImages.fileList[i].addListener(listener[i]);
}
}
function uploadImages() { upwin.alphaTo = 100; browseBtn.enabled = false; totalErrors = 0; totalBytesLoaded = 0; previousBytesLoaded = 0; for (i in tableDetails) { allImages.fileList[i].upload('upload.php'); listener[i] = new Object(); listener[i].previousBytesLoaded = 0; /// listener[i].onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void { newBytesLoaded = bytesLoaded-this.previousBytesLoaded; totalBytesLoaded += newBytesLoaded; percentage = Math.round(totalBytesLoaded/totalFileSize*100); a = 2.9*percentage; upwin.pw = a; if (percentage == 100) { setInterval(nextPage,1000); } this.previousBytesLoaded = bytesLoaded; }; //Possible file upload errors listener[i].onHTTPError = function(file:FileReference, httpError:Number):Void { file.cancel(); totalErrors += 1; }; listener[i].onIOError = function(file:FileReference):Void { file.cancel(); totalErrors += 1; }; listener[i].onSecurityError = function(file:FileReference, errorString:String):Void { file.cancel(); totalErrors += 1; }; if(totalErrors > 0){ upwin.alphaTo = 0; errorField.text = uploadErrorText; } /// allImages.fileList[i].addListener(listener[i]); } }
index.php:
<script src="flashcontent.js" type="text/javascript"></script>
<p><script type="text/javascript">insertFlash("file_upload.swf",350,325,'uploader'); </script></p>
<script src="flashcontent.js" type="text/javascript"></script> <p><script type="text/javascript">insertFlash("file_upload.swf",350,325,'uploader'); </script></p>
flashcontents.js:
function insertFlash(movie,w,h,flashvars,id)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" id="'+id+'" width="'+w+'" height="'+h+'">');
document.write('<param name="movie" value="'+movie+'" />\n');
document.write('<param name="allowScriptAccess" value="always" />\n');
document.write('<param name="quality" value="high" />\n');
document.write('<param name="flashvars" value="'+flashvars+'" />\n');
document.write('<embed src="'+movie+'" menu="false" allowScriptAccess="always" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" id="'+id+'" width="'+w+'" height="'+h+'" flashvars="'+flashvars+'"></embed>\n');
document.write('</object>\n');
}
function insertFlash(movie,w,h,flashvars,id) { document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" id="'+id+'" width="'+w+'" height="'+h+'">'); document.write('<param name="movie" value="'+movie+'" />\n'); document.write('<param name="allowScriptAccess" value="always" />\n'); document.write('<param name="quality" value="high" />\n'); document.write('<param name="flashvars" value="'+flashvars+'" />\n'); document.write('<embed src="'+movie+'" menu="false" allowScriptAccess="always" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" id="'+id+'" width="'+w+'" height="'+h+'" flashvars="'+flashvars+'"></embed>\n'); document.write('</object>\n'); }
upload.php :
<?php
$ext = pathinfo($_FILES['Filedata']['name'], PATHINFO_EXTENSION); //figures out the extension
$filename = time().'.'.$ext; //generates random filename, then adds the file extension
$theUploadFolder = 'upload' ;
$uploaddir = $theUploadFolder."/".$filename;
if (!is_dir($theUploadFolder))
{
mkdir($theUploadFolder);
chmod($theUploadFolder, 0777);
}
//move the uploaded file
move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploaddir);
?>
<?php $ext = pathinfo($_FILES['Filedata']['name'], PATHINFO_EXTENSION ); //figures out the extension $filename = time().'.'.$ext; //generates random filename, then adds the file extension $theUploadFolder = 'upload' ; $uploaddir = $theUploadFolder."/".$filename; if (!is_dir($theUploadFolder)) { chmod($theUploadFolder, 0777); } //move the uploaded file ?>
Ik wil dus bijvoorbeeld mijn bestand op kunnen roepen met bijvoorbeeld de volgende waarde:
file_upload.swf?map=$_get[ 'map' ]
file_upload.swf?map=dezemap
in AS:
upload.php?map=$_get [ 'map' ]
upload.php?map=dezemap
Is dit mogelijk?
Alvast bedankt,
Jaron.
|