1

(2 replies, posted in Core API)

Thanks for the source link. From the comments:

/**
* Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers.
* The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages
* to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique.
* It's more probable for the earth to be hit with an ansteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property
* to an user unique key.
*
* @method guid
* @return {String} Virtually unique id.
*/

You were right, we had like 10 other javascript files loading on the page and one had a jQuery ajaxSetup function that was specifically calling for a page refresh. So my request was taking that configuration as well and refreshed.

Only took me a day to figure out!.

I am using ajax to post to another script for each file that is uploaded(basically saving an xml file with meta data of the file). The problem is that the page refreshes after the first file.  I have googled like 10 other pages to try and get my page to stop refreshing after the first file to no avail. here is my FileUploaded code.  Everything works fine for the first file but since the page refreshes the following files do not get to the POST.

var uploader = $("#uploader").plupload({
        runtimes : 'html5',
        url : '/resources/ajax/pages/admin/filesystem/bcUpload.xqy',
        max_file_size : '3000mb',
        unique_names : false,
        rename: true
});


uploader.bind('FileUploaded', function(up, file, response) {       
        $.ajax({type: 'POST',
                url:  '/admin/content/save/saveBinaryContent,
                data: p,
                success: function(data) {
                    $('.preview').html('success');
                }
        });      
});

4

(2 replies, posted in Core API)

I thought I read a post previously on how the file ids are being generated, but can't find it.  Can someone point me in the right direction or explain it again?
Thanks

5

(11 replies, posted in General discussion)

I have been using a FileReader to show image previews with the FilesAdded event.

You can't use the file object that plupload creates though you need to grab the native files object from the input itself. I just call a helper function from within the FilesAdded event.

uploader.bind('FilesAdded', function() {
        handleFiles($('#uploadForm input:last')[0].files);
});

Then I follow this example here. https://developer.mozilla.org/en/Using_ … ted_images

6

(95 replies, posted in General discussion)

As of the latest version (1.5.1.1) where is the support on html5 for large files? I am required to use html5 runtime for the project i'm on.
Let me try and reiterate what i've gotten from this thread.
1. html5 requires the whole file to be uploaded to memory
2. The more memory you have on your machine the larger the file you can upload
3. Chunking is not supported in html5? (I actually tested this with 5mb chunks on a 250mb file and the upload completed, but it seems like some chunks were missing and the file remained in multiple 5mb chunks. less than 240mb worth. Is more processing required to recombine chunks? I assume this is automatic (if all chunks are successfully uploaded))

Is the github version still the only one with the additional html5 support for larger files?

7

(5 replies, posted in UI Widget)

No prob, you can thank hujer too since he was the one who helped me figure this out.

8

(4 replies, posted in General discussion)

Yes, that example does not include the Standard jQuery UI css/js libraries and therefore didn't work until I figured that out. I had assumed that jquery.ui.plupload.js and jquery.ui.plupload.css had everything I needed.

I should have known better since all the other jquery plugins i've ever used required the full libraries as well. It was just confusing that these files did not show up in the example.

Maybe It was a bit much to say not to follow the examples, but the examples found inside the downloads DO have the files included in the head section and was how I figured out my error.

9

(4 replies, posted in General discussion)

My mistake was following the examples on the website...which doesn't make sense, you would think the examples are there to help you, obviously they just caused more confusion.  DO NOT FOLLOW THE EXAMPLES!

Anyway, I guess you DO have to include the standard jQuery UI library AND css from the CDN.  That solved the styling issues.

Only took me 4 days to figure this out.

10

(4 replies, posted in General discussion)

I am having a couple issues with the UI widget.

Here is my set up in the head, all the paths are correct:

<link rel="stylesheet" type="text/css" href="screen.css"/> 
<link rel="stylesheet" type="text/css" href="plupload/js/jquery.ui.plupload/css/jquery.ui.plupload.css"/>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascript" src="plupload/js/plupload.full.js">&nbsp;</script>
<script type="text/javascript" src="plupload/js/jquery.ui.plupload/jquery.ui.plupload.js"></script>

This is the only way I can get it to work,
1. I have to also bring in the jQuery UI library as well, not just the plupload version.
2. I can only use the full.js file it wont let me only use the html5.js (I only want the html5 runtime)
3. It will load but the styles are not there, It looks like my uploader is getting generated in table format when it looks like the examples here on the site are just being rendered into divs.

Here is my set up code:

$("#uploader").plupload({
        runtimes : 'html5',
        url : 'upload.xqy',
        max_file_size : '2000mb',
        chunk_size : '5mb',
        unique_names : false,
        resize : {width : 320, height : 240, quality : 90}
    });

$('#uploadForm').submit(function(e) {
        var uploader = $('#uploader').plupload('getUploader');
        if (uploader.files.length > 0) {
            uploader.bind('StateChanged', function() {
                if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {
                    $('#uploadForm').submit();
                }
            });
            uploader.start();
        } else
            alert('You must at least upload one file.');
        return false;
    });

And my html:

<form id="uploadForm">
    <div id="uploader">
        You browser doesn't have HTML5 support.
    </div>
 </form>

11

(5 replies, posted in UI Widget)

This is working for me.

var myUploader = $('#uploader').plupload('getUploader');
 myUploader.bind('BeforeUpload', function(up, file) {
        up.settings.multipart_params = {path : $("#path").val()};
   });

12

(5 replies, posted in UI Widget)

Wow I came here with the exact same problem, if I figure it out, i'll let you know.