I am trying to use SWF Upload to upload images to my rails application
WHen I try to upload a file using a normal HTML upload form, it works just fine. In other words, the upload method in my controller reads the file and writes it to the disk.
However, when I use SWF Upload, I get no errors, the DHTML returned= 'files uploaded', but nothing is written to the server's disk. In fact, I can make several nonsensical modifications to the 'upload_script' variable, and no errors are raised, but still no file upload. I suspect this is a relative path issue.
How do you modify your path to upload_script so that you get an upload, or do you put your files in a different directory structure from that specified below:
Thanks-David
I am using SWFUpload with the following structure:
app directory/public/javascripts/jscripts/SWFUpload/SWFUpload.js app directory/public/javascripts/jscripts/SWFUpload/SWFUpload.swf
example config javascript in side of my upload form https://www.example.com/app/controller/form_for_upload: <script type="text/javascript">
var swfu; var swfu2;
window.onload = function() {
// Max settings
swfu = new SWFUpload({ upload_script: "https://www.example.com/app/controller/ file_upload_method", target : "SWFUploadTarget", flash_path : "/javascripts/jscripts/SWFUpload/SWFUpload.swf", allowed_filesize : 30720, // 30 MB allowed_filetypes : "*.*", allowed_filetypes_description : "All files...", browse_link_innerhtml : "Browse", upload_link_innerhtml : "Upload queue", browse_link_class : "swfuploadbtn browsebtn", upload_link_class : "swfuploadbtn uploadbtn", flash_loaded_callback : 'swfu.flashLoaded', upload_file_queued_callback : "fileQueued", upload_file_start_callback : 'uploadFileStart', upload_progress_callback : 'uploadProgress', upload_file_complete_callback : 'uploadFileComplete', upload_file_cancel_callback : 'uploadFileCancelled', upload_queue_complete_callback : 'uploadQueueComplete', upload_error_callback : 'uploadError', upload_cancel_callback : 'uploadCancel', auto_upload : false });
}
</script>
THanks David