0

How can I get the <s:file /> value set to form content using Dojo ?

<s:file id="fileUpload" name="upload"/>

<script>
    var fileUpload = dojo.byId("fileUpload");
    content[fileUpload.name] = fileUpload.value;
    dojo.xhrPost({
        form : form,
     content : content,
        load : function(data) {
                   processingDialog.setContent(data); },
       error : function(error) {
                   processingDialog.setContent(error); }
    });
</script>

When submitting form upload value is passing as "c:/fake path/01.csv" and not receiving to the action

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
1097733
  • 467
  • 3
  • 9
  • 18
  • You need to show more of your code. Your form declaration, your action, your struts mapping – Andrea Ligios Dec 09 '15 at 10:18
  • 1
    Hopefully you are using `Google Chrome` browser, you cannot handle the uploaded file path like this because of security [reasons](http://stackoverflow.com/questions/11897431/fileupload-in-chrome-giving-some-fake-path-value). – Vinoth Krishnan Dec 09 '15 at 10:45

0 Answers0