We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Extension: nGen File Field for FieldFrame

Development and Programming

turbineseaplane's avatar
turbineseaplane
16 posts
16 years ago
turbineseaplane's avatar turbineseaplane

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!

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

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

       
turbineseaplane's avatar
turbineseaplane
16 posts
16 years ago
turbineseaplane's avatar turbineseaplane

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! 😊

       
Derek Hogue's avatar
Derek Hogue
316 posts
16 years ago
Derek Hogue's avatar Derek Hogue
Hmm, I’m suddenly getting this error with v.0.9.10:
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 have uploads set to accept any file type, not just images. Thoughts?

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) ) { ...
       
Derek Hogue's avatar
Derek Hogue
316 posts
16 years ago
Derek Hogue's avatar Derek Hogue
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. 😊

       
turbineseaplane's avatar
turbineseaplane
16 posts
16 years ago
turbineseaplane's avatar turbineseaplane

Really? No slowdowns?

Cool. I’ll give that method a shot.

I’m still curious if there’s a way to just use the existing thumbs. They’re just sitting there, you know? 😊

       
Derek Hogue's avatar
Derek Hogue
316 posts
16 years ago
Derek Hogue's avatar Derek Hogue

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. 😊

       
LucPestille's avatar
LucPestille
146 posts
16 years ago
LucPestille's avatar LucPestille

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,

       
Jason Morehead's avatar
Jason Morehead
454 posts
16 years ago
Jason Morehead's avatar Jason Morehead
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.

       
ms's avatar
ms
274 posts
16 years ago
ms's avatar ms
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

       
Dylan Smith/Context Design's avatar
Dylan Smith/Context Design
346 posts
16 years ago
Dylan Smith/Context Design's avatar Dylan Smith/Context Design

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!

       
bmschaaf's avatar
bmschaaf
171 posts
16 years ago
bmschaaf's avatar bmschaaf

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!

       
Fred Boyle's avatar
Fred Boyle
73 posts
16 years ago
Fred Boyle's avatar Fred Boyle

@bmschaaf What other add-ons do you have installed? That kind of issue is usually another add-on preventing FieldFrame + File from properly sending it’s output. If you can try disabling add-ons one at a time until it works properly.

       
James B's avatar
James B
29 posts
16 years ago
James B's avatar James B

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]
       
Fred Boyle's avatar
Fred Boyle
73 posts
16 years ago
Fred Boyle's avatar Fred Boyle

@James_B Were the MH_File fields setup to allow multiple uploads?

       
First 19 20 21 22 23 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.