file upload

Hi,

How can i transfer my file from swfupload object by hidden input to server, where i have java.io.File type variable? When i do that:

< input jwcid="@Hidden" name="file" value="ognl:file" id="file"/>
...
function fileQueued(file) {
try {
var txtFileName = document.getElementById("txtFileName");
var a = swfu.getFile(0);
document.getElementById("file").value = a;
txtFileName.value = file.name;
} catch (e) {
alert("la lal");
}
}

i receive String type value '[object Object]' in 'a', and in hidden input.

Perhaps You have better solution.

Thanks for help.

gyphie's picture

Can't mix

You can't mix HTML File controls with SWFUpload. You must have the user click the SWFUpload file dialog button to select a file and then upload with SWFUpload's startUpload.

Security restrictions do not allow you to assign files to the HTML file control or to the SWFUpload control.

Further more the File object returned from getFile is not a string that could be assigned to an Form Element's value property. It is an object that holds several properties with data about the file. See the SWFUpload documentation.