Hello there,
I'm facing a weird problem with swf upload. When i'm trying to upload mp3,
ogg, and pdf, they are not uploaded. On the other hand, images and some
document types are uploading fine. The file types is set to "*.*", here's
my complete code:
*HTML: *
<?php include '../includes/admin-header.php'; ?>
<script type="text/javascript">
var swfu;
window.onload = function() {
var settings = {
flash_url : "swf/swfupload.swf",
upload_url: "upload.php",
post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
file_size_limit : "20 MB",
file_types : "*.*",
file_types_description : "All Files",
file_upload_limit : 100,
file_queue_limit : 0,
custom_settings : {
progressTarget : "fsUploadProgress",
cancelButtonId : "btnCancel"
},
debug: false,
// Button settings
button_image_url: "images/uploadIcon.png",
button_width: "260",
button_height: "32",
button_placeholder_id: "spanButtonPlaceHolder",
button_text : '<span class="button">Select Files <span
class="buttonSmall">(20 MB Max Each)</span></span>',
button_text_style : '.button { font-family: Arial, sans-serif;
font-size: 16pt; color: #4282c4;} .buttonSmall { font-size: 12pt; }',
button_text_left_padding: 36,
button_text_top_padding: 8,
button_cursor: SWFUpload.CURSOR.HAND,
// The event handler functions are defined in handlers.js
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
queue_complete_handler : queueComplete // Queue plugin event
};
swfu = new SWFUpload(settings);
};
</script>
<!-- SWF Starts -->
<form id="form1" action="index.php" method="post"
enctype="multipart/form-data">
<div class="fieldset flash" id="fsUploadProgress">
<span class="legend">Upload Queue</span>
</div>
<div id="divStatus">0 Files Uploaded</div>
<div>
<span id="spanButtonPlaceHolder"></span>
<input id="btnCancel" type="button" value="Cancel All
Uploads" onclick="swfu.cancelQueue();" disabled="disabled"
style="margin-left: 2px; font-size: 8pt; height: 29px;" />
</div>
</form>
<!-- SWF Ends -->
</div>
<?php include '../includes/admin-footer.php'; ?>
*Here's the PHP:*
<?php
// Work-around for setting up a session because Flash Player doesn't
send the cookies
if (isset($_POST["PHPSESSID"])) {
session_id($_POST["PHPSESSID"]);
}
session_start();
$location = "../naats/";
move_uploaded_file($_FILES["Filedata"]["tmp_name"], $location .
$_FILES["Filedata"]["name"]);
file_put_contents("un.txt", $_FILES["Filedata"]["name"]);
exit(0);
?>
--
You received this message because you are subscribed to the Google Groups
"Project Hosting on Google Code" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-code-hosting/-/CeBh5F1S4z4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-code-hosting?hl=en.