Getting uploadify to work |
[eluser]RKC[/eluser]
Hi pickupman! Thanks for the script and thanks for replying. The moment I remove the comma. The input field disappears from browser. And when I check the source, I see no problem with the input field html. It reads: <input type="file" name="Filedata" value="" id="upload" /> But there is no input field displayed on the browser. However, all this while, it works perfectly in firefox. It is only IE that is giving problems. Thanks again. RKC
[eluser]pickupman[/eluser]
@RKC I checked the demo files again. I tried it in IE6, and it was working. I attached them here again, and updated it from my site again.
[eluser]Unknown[/eluser]
Hi there, I have discovered some issue, when implementing uploadify into Zend Framework. My Code: uploadify.js (mainly from examples) Code: $(document).ready(function() { BASE_URL contains current project location starts with 'http://' Everything works good as long as this script try to find upload script on address BASE_URL + '/albums/test/http:' (BASE_URL + '/albums/test/' is page, where is uploader GUI). Manual sais: "For absolute paths prefix the path with either ‘/’ or ‘http’", but for some reason not work good for me. Any suggestions?
[eluser]thematrixuum[/eluser]
Code: $("#target").append(info); //Add response returned by controller what does this means?
[eluser]pickupman[/eluser]
[quote author="thematrixuum" date="1259851964"] Code: $("#target").append(info); //Add response returned by controller what does this means?[/quote] This is basic jQuery stuff. $("#target") specifies an html element with and id of target (ie <div id="target"></div>. Since this is called from function(info){},.append(info) means take what was echoed back by the script, and store it in the variable "info". Then append (add) to the inside of the referenced html element, which what the <div> with the id "target". http://docs.jquery.com/Manipulation/append#content
[eluser]thematrixuum[/eluser]
oh, it was supposed to return the value from the filename, filesize etc into the <div id='target'>? but how can i send the filename back into the controller? issit inside $.post()? everytime i try to save the filename into the database, it said that it was an [Object object] and cannot be saved although i already json_encode it..
[eluser]pickupman[/eluser]
I just had it echo back the sample data processed by the uploadify.php script. It's up to you how you would like to process this in the controller. The code above the line: Code: $.post("'.site_url(upload/uploadify).'", { filearray : response },function(html){ the script is passing a json object "response" as a $_POST variable "filearray" and posted to the Upload controller function uploadify. The data can be retrieved by: Code: //application/controllers/upload.php
[eluser]thematrixuum[/eluser]
woah.. thanks a mil.. some additional questions (i am not very good in javascript btw) 1. what if i want to return '1' back to the javascript so that the javascript will redirect? 2. where can i do validation, eg : if the file was already in the server or if the file is corrupt / cannot be uploaded? 3. last but not least, how can i set that whenever a user wanted to upload a file, he / she can only see the mime type that was set? thanks a mil. added : btw, when I do this : controller/upload.php Code: $data['response'] = json_decode(stripslashes(trim($this->input->post('filearray')))); Code: $(document).ready(function(){ it still returned as an alert with [Object object]
[eluser]pickupman[/eluser]
By adding ,json to the $.post callback type, you are telling the script to expect json, but right now the script is only returning plain text. Try removing the ,json after your callback. Quote:1. what if i want to return ‘1’ back to the javascript so that the javascript will redirect? Rather than Code: print_r($data); use: Code: echo 1; Quote:2. where can i do validation, eg : if the file was already in the server or if the file is corrupt / cannot be uploaded? This is already somewhat handled by uploadify. I added the CI upload functions into the uploadify script. So, if the file already exists (file.jpg), the file be renamed to file-1.jpg. If the file is not properly uploaded, the onError callback will fire. Right now, an alert is fired back with code. Code: //Original file name is stored in Quote:3. last but not least, how can i set that whenever a user wanted to upload a file, he / she can only see the mime type that was set? You could try this: Code: $this->load->helper('file');
[eluser]vijaykm[/eluser]
hi i have problem in IE 7 while uploading files ..all the session values are destroyed |
Welcome Guest, Not a member yet? Register Sign In |