dojo file upload using zend framework problem -


I am struggling with some dojo which is necessary to upload a file Now file upload form a dojo dialog box , So long as the user selects the 'upload file' button, it is hidden.

This button can be clicked anywhere on the site, so I have to handle a controller upload.

I am currently trying to work on it, and I have the following in my head script:

  & lt; Php $ this- & gt; HeadScript () - & gt; CaptureStart (); ? & Gt; Hide the sendForm () {// file input field dojo.style ('inputfilled', "display", "none"); // show progress bar dojo.style ('progress field', 'display', 'inline'); Dojo.byId ('Preface'). InnerHTML = "Uploading ..."; Dojo.io.iframe.send ({url: "& lt ;? php echo $ this-> base URL () ;? & gt; / fileprocssing / loadfile /", method: "post", handle: "text" , Form: dojo.byId ('StartFrm'), handle: function (data, ioArgs) {var fileData = dojo.fromJson (data); if (fileData.status == "success") {// file input field dojo Style (dojo.byId ('inputfield'), "display", "inline"); dojo.byId ('fileInput'). Value = ''; // hide progress bar dojo.style (dojo.byId ('progressField '), "Display", "none"), dojo.byId (' Uploaded file '). InnerHTML + "" Success: File: "+ fileData.details.name +" Size: "+ fileData.details. Size + "& lt; Br <>" dojo.byId ('preamble'). InnerHTML = " File to upload: ";} and {dojo.style (dojo.byId ('inputfield')," display "," inline "); dojo.style (dojo.byId ('progressFie ld')," display " , "None"); Dojo.byId ('preface'). InnerHTML = "error, try again:";}}})}}  

With this kind of original upload

  & lt; Form id = "startframe" enctype = "multipart / form-data" name = "cvupload" action = " base url () ;? & gt; / fileprocssing / loadfile /" method = "Post" & gt; & Lt; Input type = "hidden" name = "MAX_FILE_SIZE" value = "500000" & gt; & Lt ;! - dojo.io.iframe.submit () does this based on what it does to be able to modify parts of this form - & gt; & Lt; Span id = "preamble" & gt; File to upload: & lt; / Span & gt; & Lt; Br> & Lt; Span id = "inputField" & gt; & Lt; Input type = "file" id = "fileInput" name = "uploadFile" & gt; & Lt; / Span & gt; & Lt; Span id = "progressField" style = "display: none;" & Gt; & Lt; Div dojoType = "dijit.progressbar" style = "width: 200px" unsure = "true" & gt; & Lt; / Div & gt; & Lt; / Span & gt; & Lt; Br / & gt; & Lt; Button value = "upload" dojoType = "dijit.form.button" onclick = "sendForm ()" & gt; Upload & lt; / Button & gt; & Lt; / Form & gt;  

I would like to know how can I get the JSON data object / fileprocssing / loadfile / from which the upload data is called / some controller / some action /?

  Public function loadfileAction () When the file is automatically redirected to / / file processing / reviewData /  

in some way, {$ Log = Zend_Registry :: GetInstance () - & gt; Receive ('log'); $ Log- & gt; Log ('LoadFileAction', in Zend_Log :: DEBUG); $ Log- & gt; Logs ($ _ files ['uploadfile'] ['name'], z_log :: DEBUG); $ Uploadfile = array ('description' => gt; $ _FILES ['uploadfile'], 'position' = & gt; 'success'); $ Log- & gt; Log ($ fileUploadData-> toJson (), Zend_Log :: DEBUG); $ Foo = "{'Status':' Success', Description: {name: ''. $ _FILES ['uploadFile'] ['name']. '', Size:". $ $ _FILES ['uploadFile'] [' Size ']. "}}" $ Log-> Log ($ foo, Zend_Log :: DEBUG); $ this- & gt; View-> File data = $ foo;}

I have signed JSN data for a while, but will use Zend_Dozo_Data but at the moment I am trying to do this work.

Let me confess that I do the dojo well Do not know, but to get your head in the shortest possible time I am trying.

Thank you in advance.

dojo.io.iframe .send requires feedback data wrapped in the TEXTAREA tag.This is the only / easiest cross browser way to successfully load and load access data, and there is a need. Back from action.

You also have to adjust your handle to be "Jason" And can intercept the intermediate dojo.fromJson (data) call, it will be sent to you as a JSON object (provided the reply is wrapped in the aforementioned TEXTAREA)


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -