-4

How do I create thumbnails and save them in a folder on my server?

For example, each uploaded picture saves to a files/big folder and a thumbnail is created and saved to a files/thumb folder.

I have found several PHP image resize scripts for free including TimThumb and phpThumb.

Is a thumbnail capability already built-in with Fineuploader?

  • Yes, Fine Uploader already generates client side previews for you. See the previews feature documentation for details at http://docs.fineuploader.com/branch/master/features/thumbnails.html – Ray Nicholus Feb 04 '14 at 01:56

1 Answers1

0

Is this in the right direction? I got everything working including simple thumbnails. Now all I need to do is have the files uploaded to two dirs, big and thumb (also bypassing the UUID creation so they all go in one folder). How do I set the URLs?

<script>
function createUploader()
{
    var uploader = new qq.FineUploader(
    {
        element: document.getElementById('fine-uploader'),
        request: {endpoint: 'fineuploader/endpoint.php'},
        onComplete: function(id) {updatePicture(id)}
    });
}

function updatePicture(fileId)
{
    var fileId='fineuploader/';
    uploader.drawThumbnail(fileId, document.getElementById('picture'), 200, true);
}

window.onload = createUploader;
</script>
  • File IDs are numbers, and they are assigned by Fine Uploader to each submitted file internally. If you want to display thumbnails, you don't need to use `drawThumbnail`, just make sure you have the proper elements in your template. This is discussed in the link I posted in my comment. There are also demos that utilize the client-side preview generation at http://fineuploader.com/demos – Ray Nicholus Feb 04 '14 at 05:16
  • I need to save the thumbnails in a folder. For me, the documentation is too confusing/complicated on this matter. A variable at the top of the code for save URLs (both pictures and thumbnails) would be excellent for noobs like myself. Perhaps I will add this to Git Requests. – user3140307 Feb 04 '14 at 16:11
  • I completely understand. There is an open feature request for generating resized images and allowing them to be easily uploaded. Please see https://github.com/Widen/fine-uploader/issues/1061. This is a popular feature request, and will likely be completed in the near future. Please see the issue and comment if you'd like. – Ray Nicholus Feb 04 '14 at 16:18