Does anyone know if it’s possible to use the automatically generated thumbnails on the front end of a site?
Since nGen File Field is already making thumbnails for use in the Control Panel, I’d sure love to be able to call those directly on the front end of the site, but there doesn’t seem to be a tag to do so.
Anyone thought of this or done this perhaps?
Anyone at nGen have any thoughts?
Thanks!
I could well be wrong on this one as I haven’t really used the nGen File Field all that much but I think those thumbnails are created using just CSS. I could be wrong however.
Your best bet either way though would be to install the excellent Image Sizer plugin to re-size images for you. This is pretty much a staple install on most sites people make around here and it really is a great add-on to ExpressionEngine and the nGen File Field.
Hope that helps a bit.
Best wishes,
Mark
Hi Mark…
Thanks for your thoughts.
I checked the server and nGen File Field actually creates a thumbnail directory and actual thumbnails with a _thumb extension on them.
I hear you on the imgsizer, I’m just doing a client project that really can’t have any such slowdowns due to LOADS and LOADS of photos, you know?
I’m really hoping there’s a way to directly call and use those thumbs that are just sitting there waiting to be used! 😊
Hmm, I’m suddenly getting this error with v.0.9.10:I have uploads set to accept any file type, not just images. Thoughts?Notice: exif_imagetype() [function.exif-imagetype]: Read error! in /[my_path]/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 797
I’m getting this exact same error in the exact same situation. My guess is that it’s trying to get an image type from a PDF or DOC, and getting upset when it can’t.
I fixed this by prefixing the exif_imagetype call with the @ character (line 797):
switch( @exif_imagetype($file) ) { ...
I hear you on the imgsizer, I’m just doing a client project that really can’t have any such slowdowns due to LOADS and LOADS of photos, you know?
ImgSizer doesn’t really slow down the server at all, as it only creates the sized images once and caches them for subsequent requests. 😊
You totally could. It would involve turning on PHP, and then using PHP to manipulate what’s returned by {name_of_your_file_field show="filename"}. Explode that string into the file name and file extension, add “_thumb” in-between, put it back together, then hard-code the URL of your upload directory + ‘thumbs’ into the template. 😊
Is there a way of getting the file size of the uploaded file from this plugin? I’m using it for podcasts, and iTunes wants a filesize as part of it’s RSS feed…
I don’t think so. However, you could get the filesize using PHP’s filesize function and some custom code.
Is there a way of getting the file size of the uploaded file from this plugin? I’m using it for podcasts, and iTunes wants a filesize as part of it’s RSS feed… Thanks,
There is a plugin from Andy (aka ExpressionEngineer) somewhere in this thread to get the file size in a human-friendly format.
HTH -Markus
Updated w/ fix:
I’ve futzed about for hours with this, trying various settings, but can’t seem to fix it.
When uploading, no matter what, I get these errors:
Warning: exif_imagetype() [function.exif-imagetype]: Filename cannot be empty in /home/usr/public_html/mysite.com/system/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 539 Warning: Cannot modify header information - headers already sent by (output started at /home/usr/public_html/mysite.com/system/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php:539) in /home/usr/public_html/mysite.com/system/core/core.functions.php on line 296
When I update, the cursor’ll spin for about 30 seconds, and then I get the errors.
I’m using FieldFrame 1.1.2 & File Field 0.9.10. Any ideas what’s wrong - I’d really like to get this working!
THE FIX:
In case anyone else is as clueless as me…
B/c of my (shared/php5) hosting setup, .htaccess wasn’t overriding the php.ini value for max_upload_filesize.
Had to create a suPHP_ConfigPath /home/username pointer in .htaccess to point to a custom php.ini
Seems to work great now!
Fist off– Hello Fred, thank you very much for all the work you have put into this. We all appreciate it.
Second–my question– I am having the same issues as others where I am having to hardcode the directory url.
<a href="/c2/images/uploads/{supp-file}">{supp-type}</a>
If I just put the ngen file field column name …like this…
<a href="http://{supp-file}">{supp-type}</a>
(I believe that is all I should have to do- as I would think the add-on knows where I uploaded the file to and/or selected it from as an existing file…)
…I get the url of my current page plus the supp-file file name. “http://samplesample.com/c2/index.php/research/project/DomTex-bib.txt” for example.
Any ideas?
Thanks!
Works great overall, but I’m hitting an odd issue. So I replaced Mark H’s FILE extension with this. Overall it seemed fine, but I’m finding on some pages, a pre-existing entry will now output with a space (or something) after it. If I remove the file but leave it on the server, then reselect it using your extension, the problem goes away. I’d prefer not to use this fix as I have a few hundred documents to fix manually then. Here are 2 example pages.
Broken (worked before change to your field type) http://www.cthmis.com/files/file_detail/127
The File I fixed (Scryb preview works now) http://www.cthmis.com/files/file_detail/374/
I am sure the different is a space or break being added after the cf_file_file tag below that I’m seeing when I view source, but not sure why it’s popping up and then fixed by re-applying.
Thanks for your help and the great extension! <pre><code>
[removed]
var scribd_doc = scribd.Document.getDocFromUrl('http://www.cthmis.com{cf_files_file}','pub-23085055262806102557');
scribd_doc.addParam("height", 400);
scribd_doc.addParam("width", 680);
scribd_doc.addParam("public", true);
scribd_doc.write('embedded_doc');
[removed][/code]
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.