Here are a fancy uploader
Uploading other file types
Harald Kirschner and others have pointed out that all files that are parsed using any flash uploader are of the MIME type “application/octet-stream”, which makes it useless to identify and authorize a particular file type. Hence at present a usable hack is based on checking the file extension. Replace your existing script.php with this one and modify the third line to suit your needs. If your server has MIME magic in PHP installed, I would recommend using the following to extract the MIME information:
Changing the files that are displayed with “Browse Only…”
Go to index.php and modify the line:
I noted that for example if you want to find pdfs only, you can change it to:
swiffy.browse({'Files (*.pdf)': '*.pdf'})
What I modified
I added the following lines to script.php, which allows your files to be *actually* uploaded to a folder, in this case uploadedfiles/, which should be created inside the directory that contains the upload script.
Uploading other file types
Harald Kirschner and others have pointed out that all files that are parsed using any flash uploader are of the MIME type “application/octet-stream”, which makes it useless to identify and authorize a particular file type. Hence at present a usable hack is based on checking the file extension. Replace your existing script.php with this one and modify the third line to suit your needs. If your server has MIME magic in PHP installed, I would recommend using the following to extract the MIME information:
Code:
$f = finfo_open(FILEINFO_MIME); $mime = finfo_file($f, $_FILES[’Filedata’][’tmp_name’]); finfo_close($f);
Go to index.php and modify the line:
Code:
swiffy.browse({'Images (*.jpg, *.jpeg, *.gif, *.png)': ‘*.jpg; *.jpeg; *.gif; *.png’})
swiffy.browse({'Files (*.pdf)': '*.pdf'})
What I modified
I added the following lines to script.php, which allows your files to be *actually* uploaded to a folder, in this case uploadedfiles/, which should be created inside the directory that contains the upload script.
Code:
move_uploaded_file($_FILES[’photoupload’][’tmp_name’], “./uploadedfiles/”.$_FILES[’photoupload’][’name’]); chmod(”./uploadedfiles/”.$_FILES[’photoupload’][’name’], 0777);
Comment