Getting past HTTP 302 with Multi-File Uploaders?

Has anybody come up with a way to get past the 302 errors that the multi-file uploaders are giving when trying to use them with Coldbox? I get it with both CF’s CFFILEUPLOAD and also with jQuery’s Uploadify. I set either to my handler, e.g. user.imageUpload, which of course then calls the model’s user.imageUpload method. This worked fine using regular single-file upload. I modified the handler method to do an event.renderData(“JSON”, str) and set the STATUS code to 200 as I’ve seen in various blog posts, but that isn’t helping. I’m using v3.1.0 and CF9.01 if that matters.



I don’t know. I’ve used ColdBox to upload files and never had an issue. Where are you being redirected to? If it is a flash-based uploader, remember that flash doesn’t return cookies unless you’re in IE. Well, to be more specific, flash only returns IE’s cookies which is only useful if you’re logged into the site in IE. I use uploadify, but to keep my upload event from redirecting to the login screen, I had to add the CFID, CFToken and JSessionID into the upload URL so ColdFusion would recognize the session.

If that’s not your issue, I would recommend using a step debugger to find out where the redirect is coming from.



Hi Rob

Please post your upload code, hard to guess what could be wrong. Just make
sure file field name should be pass as string ..

Here is some sample code for multi-upload
//inject DI
property name="FileUtils" inject="coldbox:plugin:FileUtils";
var result = FileUtils.uploadFile(fileField= "file", destination=imgPath);

//cfm code
<!--- Multiple files uploader --->
<div class="row-fluid">
<div class="widget">
    <div class="title">
    <img src="images/icons/dark/upload.png" alt="" class="titleIcon" />
<h6>Multiple file uploader</h6>
    <div id="uploader"></div>
<div class="row-fluid"><br/><br/><br/><br/></div>
//===== File uploader =====//
jQuery(document).ready(function() {
runtimes : 'html5,html4',
url : '/coreadmin/Image/saveImage',
max_file_size : '100mb',
unique_names : true,
filters : [
{title : "Image files", extensions : "jpg,gif,png,jpeg,bmp"}
//{title : "Zip files", extensions : "zip"}