Sure...
PHP - Codeigniter
- Code: Select all
public function albums_photos_upload_do()
{
$aid = $this->uri->segment(4);
$file_location = $this->config->item('file_url').$this->config->item('assets_dir').$this->config->item('users_dir');
$config['upload_path'] = $file_location;
$config['max_size'] = '11264';
$config['allowed_types'] = $this->config->item('img_types');
$config['encrypt_name'] = TRUE;
$this->load->library('upload', $config);
if(!$this->upload->do_upload('Filedata'))
{
echo $this->upload->display_errors();
}
else
{
$data = $this->upload->data();
//do other things here
}
exit(0);
}
Javascript
- Code: Select all
<script type="text/javascript">
var swfu;
window.onload = function() {
var settings = {
flash_url : "<?=base_url()?>assets/js/swfupload/swfupload.swf",
upload_url: "<?=base_url().$this->config->item('admin_dir').$this->module?>albums_photos_upload_do/<?=$aid?>",
file_post_name : "Filedata",
file_size_limit : "10 MB",
file_types : "*.jpg;*.gif;*.png",
file_types_description : "Image Files",
file_upload_limit : 50,
custom_settings : {
progressTarget : "fsUploadProgress",
cancelButtonId : "btnCancel"
},
debug: <?=$debug?>,
// Button settings
button_image_url : "<?=base_url()?>assets/js/swfupload/file_upload_icon.jpg",
button_width : 75,
button_height : 75,
button_placeholder_id: "spanButtonPlaceHolder",
button_text: '',
// 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>
SWFupload debug code
- Code: Select all
...
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 47485. Total: 47485
SWF DEBUG: Event: uploadSuccess: File ID: SWFUpload_0_0 Response Received: true Data: <p>You did not select a file to upload.</p>
SWF DEBUG: Event: uploadComplete : Upload cycle complete.
Which XAMPP Version do you use? - 1.7.3
Which OS do you use? - Windows 7 64bit
Do you have changed anything in the configs? - Nothing in Apache - httpd.conf
php.ini:
- Code: Select all
short_open_tag = On
error_reporting = E_ALL & ~E_NOTICE
display_errors = off
display_startup_errors = off
extension=php_curl.dll
date.timezone = "America/New_York"
Shall we guess whats happening / went wrong there? - sure, go for it
Let's ask my crystal ball...
ehm... my crystal ball says "short_open_tags". - short_open_tag = On - if it wasn't the application wouldn't run at all
Any other information you need???
Next time try to assume that this is not my first go around with PHP and a server...