Welcome Guest, Not a member yet? Register   Sign In
Ajax Uploader and IE
#1

[eluser]skunkbad[/eluser]
I've been working on an ajax uploader this evening, and it works great, except for in IE. I haven't tested it on a production server, only my Windows 7 development server that has xampp. IE doesn't seem to receive the ajax responses that need to be parsed for confirmation of upload (or to show errors). Is this typical for IE because of a same machine type restriction?
#2

[eluser]SPeed_FANat1c[/eluser]
I use valums ajax upload library and for me it works on loacalhost and on remote server even on IE. I use XAMPP, windows vista.
#3

[eluser]skunkbad[/eluser]
[quote author="SPeed_FANat1c" date="1299685212"]I use valums ajax upload library and for me it works on loacalhost and on remote server even on IE. I use XAMPP, windows vista.[/quote]

That's the script I'm using. It works now. The problem is that IE doesn't like an XML response, and I spent a while trying to encode/decode before finally switching to another response type. I changed my response to json and all is well.
#4

[eluser]RS71[/eluser]
Could any of you post the code that you're using? I'm thinking of using that upload library but doesn't it have security measures than the CI upload lib?

Cheers
#5

[eluser]SPeed_FANat1c[/eluser]
http://valums.com/ajax-upload/

I actually use the older version of valums lib but the newer should also work with CI I think.

"but doesn’t it have security measures than the CI upload lib?"

I think security is the same, because when we use this ajax upload library, we still write php function e.g. do_upload and use the CI's upload library. Its the same, just without page refreh.
#6

[eluser]skunkbad[/eluser]
In case you need a working example, I put one in the Wiki:

http://codeigniter.com/wiki/Ajax_Uploader/
#7

[eluser]Unknown[/eluser]
Ajax uploader and IE are both convenient to use.Each one has their their own features and advantages but each cannot be use for all application.The latest versions of IE are modified a lot and has very advanced features.Ajax uploader in its advanced feature is not that developed.

<a href="http://www.doverdowns.com/delaware-meeting-and-conference-venue/">washington dc conference center</a>
#8

[eluser]seibelj[/eluser]
Here's how to use the latest Valums Ajax Uploader with the progress bar:

Download latest one here: http://valums.com/ajax-upload/

Extract the download. In the extracted folder is the server folder, and inside that is a file named php.php

Put php.php in your application/libraries folder and rename it qquploadedfilexhr.php

Delete the final lines that are not part of any class (line 154 and after in my version).

Create a controller function for where you want the uploader action to be. Inside the function put this code:

Code:
$this->load->library('qquploadedfilexhr');

// list of valid extensions, ex. array("jpeg", "xml", "bmp")
$allowedExtensions = array('txt');
// max file size in bytes
$sizeLimit = 1 * 1024 * 1024;

$uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
$result = $uploader->handleUpload('YOUR PATH TO UPLOAD FOLDER');
// to pass data through iframe you will need to encode all html tags
echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);

Change the file extensions and size to what you want, and you MUST put in the correct path to the upload folder (mine is /var/www/website-name/www/uploads).

Include the javascript and CSS files on your page, and this in your markup where you want the upload button:

Code:
<div id="file-uploader">      
    <noscript>          
        <p>Please enable JavaScript to use file uploader.</p>
        &lt;!-- or put a simple form for upload here --&gt;
    </noscript>        
</div>

Create a new javascript file and put this in it, and include it on your page:

Code:
$(document).ready(function() {
    var uploader = new qq.FileUploader({
        // pass the dom node (ex. $(selector)[0] for jQuery users)
        element: document.getElementById('file-uploader'),
        // path to server-side upload script
        action: 'FULL PATH TO UPLOAD FUNCTION'
    });
});

Change action: 'FULL PATH TO UPLOAD FUNCTION' to the server route, like http://localhost/index.php/controller_na...d_function.

This works fine for me, let me know if you have any problems. Make sure to increase the max file upload size in php.ini to the max size you set for the upload, or you'll get an error.
#9

[eluser]skunkbad[/eluser]
It would be nice if the CI upload library worked with php://input, because then you wouldn't need the php.php script. I added this to feature requests over at uservoice. PDF documents that post also require that you check php://input, and there are probably more reasons to need this in the upload library.




Theme © iAndrew 2016 - Forum software by © MyBB