Do you need chunks?  If you don't use chunks the file will appear as one piece on the server which might be a bit easier to handle.

Regardless you need to handle the uploaded file on your server (whether it comes in in chunks or one piece).  Deal with it in upload.php - or whatever you write to handle the incoming POSTs from the web browser on your server.

Oh and if you want every image resized to have the same width, but the height varies to match the aspect ratio of the source image you could try setting the resize width to your chosen width, and the resize height to a very large number (larger  than the height of any possible source image).

Do you mean when resizing an image?  If so the height and width specified  are maximums.  The image aspect ratio is always preserved.

So specifying a resize width and height of 320x240 doesn't mean all of the images will be made exactly 320x240 - but they will be resized such that one of the dimensions will be 320 or 240 (or it will be exactly 320x240 if your source image happens to have an aspect ratio of 320/240).

I don't use PHP myself, I use Ruby on Rails.  Perhaps someone else might help you debug your PHP.  Barring that I'd suggest doing some reading on PHP (e.g. http://www.php.net/docs.php).

@7th - have you printed out what your upload.php is actually setting the targetDir variable to?  It looks like it is having problems with permissions on that directory (either creating it, or using it?).

Check out the examples that come with plupload.  They have both the javascript code needed in the web-browser and sample php code for the server.  It looks like your server is using PHP for the server side processing so it should be "relatively" simple to put together something using the examples from plupload.

207

(8 replies, posted in General discussion)

This sort of thing gets discussed a lot so searching the forum would be a good idea.

I don't know if you are planning on using one of the widgets or just the core plupload API.  I'm not very familiar with the Widgets, although they use the core API so you can probably do similar manipulations with them.  For the core API you can intercept the Files selected before plupload begins to upload the files by registering a FilesAdded event before you call the init() method - you could then deal with limiting the total upload by size in  some way.

Here is a discussion on the topic of getting the Files selected before plupload does:

http://www.plupload.com/punbb/viewtopic.php?id=473

Also there is a feature request here discussing something similar:

https://github.com/moxiecode/plupload/i … #issue/195

As I mentioned above though, you should search through the forum as this class of problems gets talked about a lot.

Sorry Sagar, didn't notice that you were using the flash runtime exclusively.  Flash is buggier than normal on Linux (it's always been that way) so I would avoid it as your first choice.  Use html5, then flash.  All browsers on Linux support html5 without a problem.

Also you can test client side ability of your Linux browser and various runtimes using the examples provided with plupload (they come in the zip file).  Also the examples run on the plupload web-site unmodified.  You can point your browser at:

http://plupload.com/example_all_runtimes.php

and try out the flash runtime on plupload 1.4.2 to see how it works (I just uploaded your test image successfully using Firefox 3.6 on Linux and the flash runtime on the example page).

But as I mentioned before Flash can be buggy on Linux, I'd go with html5 as your first choice.

209

(1 replies, posted in General discussion)

I don't believe so.  As a general rule web browsers do not let javascript "simulate" user events for security/usability reasons.

Yes I did try the sample image (DSCN2528.jpg) through my own app that uses plupload 1.4.2, I had not trouble uploading from a Linux workstation.

I'd suggest you try some of the examples that come with plupload 1.4.2 to narrow down where the problem may be.

I've uploaded the image successfully on Firefox 3.6 and Chrome 10 under Ubuntu Linux (10.04 release).

I haven't tried your configuration but I ran it through my application that uses plupload 1.4.2 and a variation on the custom example that comes with plupload.  I may try your config if I have time later this week.  For what it's worth I've never had a problem with plupload (any version) on Linux and not on other operating systems.

Can you be more specific?

I can confirm that flash resize and upload works in Firefox 3.6 and Chrome 10 on Ubuntu Linux 10.04.  Although I did not test with chunking on as I don't have an easy way to test this.  I used a variation on the custom example that comes with plupload.

There is a pull request for this pending in case anyone was wondering:

https://github.com/moxiecode/plupload/pull/248

216

(9 replies, posted in General discussion)

Nice pic by the way smile

I'd be interested in this features as well.

218

(9 replies, posted in General discussion)

Just upload your PNG file to a free image hosting site.  For example:

http://tinypic.com/

And then post a link to the image you've uploaded.

If anyone is interested someone else has logged an issue about this on github:

https://github.com/moxiecode/plupload/issues/240

It would be easier to answer if you gave a little more context and posted some code.

Where are you changing the reference to upload.php in your code?  Are you working with one of the examples or putting plupload into your own site?  And are you using the JQuery widget or working with the lower level API?

There is no need to build anything if you are using a released version.  The latest release is 1.4.2 and is available here:

http://www.plupload.com/download.php

Look at the examples to see how to include the appropriate files from the release package in your web pages and make use of plupload to upload your files ( the source code from the examples are also included in the release package):

http://www.plupload.com/example_queuewidget.php

Regards,
Mike

222

(4 replies, posted in General discussion)

Probably not a lot of immediate help to you but I don't have any problems using plupload to upload multiple files in IE8.  I'm using my own code which, at it's core, is pretty much the same as the custom example - and v 1.4.2 of plupload.  I specify the html5, flash and html4 runtimes.  IE8 is using the flash runtime to handle the multiple file upload without any problems.

Are you sure you've got the server side code running properly?  Which runtime are you using on IE?  Which version of IE are you using?

There is a discussion with code examples of immediate upload in this thread:

http://www.plupload.com/punbb/viewtopic.php?id=437

And here is a very stripped down example of immediate upload here:

https://gist.github.com/815706

The example uses the html4 runtime only (it was for a bug report), but you could change it to use any/all runtimes by including the appropriate plupload runtime file and modifying the "runtimes:" setting.  For example:

add:

<script type="text/javascript" src="plupload.html5.js"></script>
<script type="text/javascript" src="plupload.flash.js"></script>
.... (and whatever other runtimes you want)

likwise:

runtimes:'html5, flash, html4' ,  // And add any others here as well.

224

(5 replies, posted in General discussion)

You must call the init function between creating your instance of plupload and binding your FilesAdded callback.

I also have a call to up.refresh before calling start in my FilesAdded callback as well.  I'm not sure if this is still needed for any of the runtimes but at one time it was needed (for flash maybe??).  Anyway it doesn't hurt - you can try it with or without and make up your own mind.

See below for my suggested changes.

Mike

  <div id="container">
    <a id="pickFiles" href="#"><img src="img/picture_add.png" /></a>
  </div>

<script type="text/javascript">

    var uploader = new plupload.Uploader({
      runtimes : 'flash',
      browse_button : 'pickfiles',
      container : 'container',
      max_file_size : '10mb',
      url : '<?php echo $me ?>',
      flash_swf_url : '/plupload/js/plupload.flash.swf',
      filters : [ {title : "Image files", extensions : "jpg,gif,png"} ],
      resize : {width : 320, height : 240, quality : 90}
    });

    uploader.init;   //  ** Init the uploader.

    uploader.bind('FilesAdded', function(up, files) {
      up.refresh();   //  ** this seems to show up in lots of examples as well.
      up.start();
    });

    uploader.bind('FileUploaded', function(up, file) {
      alert("File uploaded");
    });

    uploader.init();
</script>

Thanks davit,

This worked well.  For others with the same problem here is a more complete description of what I did in code (well close enough to code at least):

overSizedFiles = [];
numberOfFilesSelected = 0;

var pluploader = new plupload.Uploader({
    runtimes : 'html5,flash,html4',
    .... 
});

pluploader.bind('FilesAdded', function(up, files)
{
    numberOfFilesSelected = files.length;
    return true;
});

pluploader.init;

pluploader.bind('Error', function(up, err)
{
    up.refresh();

    if(err.code === plupload.FILE_SIZE_ERROR)
    {
        overSizedFiles.push(err.file.name);

        if(overSizedFiles.length === numberOfFilesSelected)
        {
            alert("These Files are too large and will not be uploaded: " + 
                    overSizedFiles.join(", "));
            overSizedFiles = [];
            numberOfFilesSelected = 0;
        }
    }
    else
    {
        // Notify about other types of errors here.
    }
});

pluploader.bind('FilesAdded', function(up, files)
{
    if(overSizedFiles.length !== 0)
    {
        alert("These Files are too large and will not be uploaded: " + 
                overSizedFiles.join(", "));
        overSizedFiles = [];
        numberOfFilesSelected = 0;
    }

    ....
});

Thanks again.