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

Eric Snyder's avatar
Eric Snyder
202 posts
15 years ago
Eric Snyder's avatar Eric Snyder

I just installed this extension. I have done so before with sucess but this time I am having a problem. When I do to add an entry in the weblog that has the field I get the following errors:

Notice: Undefined index: extension in /nfs/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx.xxxxx/html/eeadmin/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 824 Notice: Undefined index: extension in /nfs/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx.xxxxx/html/eeadmin/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 824

I have tried to uninstall and reinstall but to no avail. I still get the errors.

Any ideas?

       
Eric Snyder's avatar
Eric Snyder
202 posts
15 years ago
Eric Snyder's avatar Eric Snyder

OK…really weird problem. I doubt this will come up much but here it is…

This error is happening when the extension is looking for image files in the destination folder so that it can present a list of alternate images to use that are already on the server.

Somehow the customer had uploaded a file that had no extension and was getting identified by exif as a JPG image by the function _is_image on line 792. Since the file had no extension if was creating the error.

In this case I just deleted the file as it was clearly in this folder by accident. I suspect that the user just accidentally uploaded a file from their drive. I did not add any code to the extension but possibly doing some error checking to make sure the file has an extension would be good.

Thanks for the awesome extension, I am now using it for file uploads on new installs and sometimes adding it to old installations.

       
allibubba's avatar
allibubba
57 posts
15 years ago
allibubba's avatar allibubba

i’ve been stuck on this for a few hours and can’t seem to get anywhere… i’ve transfered a site from my dev server to a live domain with a new host, but all my nGen fieldFiles that have been uploaded do not display, checked my source and just see the file name, not the file path…

been looking for path settings everywhere, have updated my system config and File Upload Preferences, all have correct url and server path. i can even see the image thumb when editing an entry, it’s just on the front end that there is no path.

i had been using {my-custom-field} which would render a complete src for my image, including file path and file name, and i would like to not have to go through all my templates and change to my/upload/path

any help or ideas or direction?

update:: ran a test by creating a new text field and using the default EE upload, works fine, get full image path and file name on the front-end, wondering if fieldFile is not understanding my file upload paths

       
Ross1988's avatar
Ross1988
59 posts
15 years ago
Ross1988's avatar Ross1988

any idea..

{exp:weblog:entries weblog="my-weblog" track_views="one" limit="1"}

{image_upload}  // my FF Matrix name
{image}         // nGen file upload
{/image_upload}

{/exp:weblog:entries}

i can see the image thumbnails in the edit screen, so the images are being uploaded properly

however there is no output when using the above code. nothing in the source.

presumably its installed correctly as I can see the images I upload in the edit panel, and i can add/remove photos as expected.

thanks

edit hmmm cleared my cache and it appears to be working fine now..slightly skeptical

regardless, fantastic addon (now its working!) thank you.

       
bmschaaf's avatar
bmschaaf
171 posts
15 years ago
bmschaaf's avatar bmschaaf
any idea..
{exp:weblog:entries weblog="my-weblog" track_views="one" limit="1"}

{image_upload}  // my FF Matrix name
{image}         // nGen file upload
{/image_upload}

{/exp:weblog:entries}
i can see the image thumbnails in the edit screen, so the images are being uploaded properly however there is no output when using the above code. nothing in the source. presumably its installed correctly as I can see the images I upload in the edit panel, and i can add/remove photos as expected. thanks

I am not sure what track_views is supposed to do…but, maybe try to remove that?

edit: Looked up track_views in the docs. Hmm, don’t see the purpose, but whatever, I guess that isn’t the issue.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
15 years ago
Matt Weinberg's avatar Matt Weinberg

Track_views is a standard EE parameter.

Ross1988– are you sure your FieldFrame path settings are correct? Both of them?

       
Ross1988's avatar
Ross1988
59 posts
15 years ago
Ross1988's avatar Ross1988

Sorry - edited my original post but you both replied soon after

all appears well now after clearing my cache

not entirely sure why that fixed things but that’s all i changed.

@bmschaaf http://expressionengine.com/docs/modules/weblog/entry_tracking.html

Thanks anyway!

       
bmschaaf's avatar
bmschaaf
171 posts
15 years ago
bmschaaf's avatar bmschaaf
This error is happening when the extension is looking for image files in the destination folder so that it can present a list of alternate images to use that are already on the server. Somehow the customer had uploaded a file that had no extension and was getting identified by exif as a JPG image by the function _is_image on line 792. Since the file had no extension if was creating the error. In this case I just deleted the file as it was clearly in this folder by accident. …

Thanks a million for posting this. Just today I had a customer do the same thing. I deleted the files that had no extension, and the site is working perfectly again.

I wonder if this would be considered a bug- Maybe a check needs to be done at the time of upload, and if there is no file extension, state error and disallow upload? Fred?

shrug. Again, thanks Eric.

       
Nightshade's avatar
Nightshade
22 posts
15 years ago
Nightshade's avatar Nightshade

The extension is causing my edit weblog page to go blank. Disabling the extension shows the edit weblog page. I have checked my with PHP Info and my memory limit is set to 128mb. Before this problem was rectified by deleting a 1.34mb image file (surely the extension should be able to deal with a file of this size?). I’ve since imposed a 300kb limit on image uploads but something has again broken it.

Any ideas??

       
Nightshade's avatar
Nightshade
22 posts
15 years ago
Nightshade's avatar Nightshade

I have isolated this problem to another image that has been uploaded. It is a JPG, 289 KB in size, 72dpi RGB, 2112 x 2816 pixels. After some experimentation resizing the image, it turns out it is not the image file size that is the problem, but the pixel dimensions. At 3 bytes per pixel (RGB) this works out to be 17.8MB Once I resize it down to 1800 x 2400px (12.4MB) my edit page showed again. Resized to 1875 x 2500px (13.4MB) it broke my edit page. Taking the square root of 12M / 3 = 2000 x 2000 pixels. I have therefore gone to Admin > Weblog Administration > File Upload Preferences and changed my max upload pixel dimensions to 2000 x 2000px. Given that the problem seems to be related to pixel dimensions NOT file size, I have also upped my size limit to 4MB (4096000 bytes). Hope this helps others with the same problem.

       
Argyll's avatar
Argyll
67 posts
15 years ago
Argyll's avatar Argyll

I need to set up some product information pages. Each product will be a “weblog” entry. Each product will have multiple photos associated with it that I’d like to upload along with the product information. My goal is to be able to pull each product’s photos out in an XML file so that they can be shown in a Flash slideshow thingie.

Can nGen/FF be used to accomplish this?

       
wbjp's avatar
wbjp
89 posts
15 years ago
wbjp's avatar wbjp

When I try to upload an image through an nGen field I get

“Fatal error: Call to undefined function imagejpeg() in /home/mydomain.com/system/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 907”

Despite the error, the image is uploaded to the uploads directory but the only way I can get rid of the error message is by deleting the uploaded image.

Very fustrating… wondering if anyone can help?

It’s a completely new EE install, the only addons are FieldFrame, Playa, wygwam and they are both working.

EE 1.6.8 Build: 20091201

Apache 2.1.14 PHP 5.2.11 ( Memory limit 128MB ) MySQL 5.1.41 PHP Upload limit 20MB

Thanks

       
Nightshade's avatar
Nightshade
22 posts
15 years ago
Nightshade's avatar Nightshade

Image size / memory problems update

Today I was STILL having problems with my site as the edit weblog page went down AGAIN, due to a large image even though I had imposed a limit of the pixel dimensions. Looking through the extension’s source I found there was no check for image dimensions against the upload limits set in EE’s Admin > Weblog Administration > File Upload Preferences page, which there should be.

I therefore wrote code in ‘ft.ngen_field_field.php’ to add this check: On line 584 before ‘return $file_name;’ I added this:

// JOE MOD: Check image is correct dimensions. We have to do this after the upload.
            list($upload_width, $upload_height) = getimagesize($upload_path . $file_name);
            
            $max_width = $this->upload_prefs['max_width'];
            $max_height = $this->upload_prefs['max_height'];
            
            // If we have a limit on image size and the image is bigger
            if( ($allowed_types == 'img' && $is_image == true) && ( ($max_width > 1 && $upload_width > $max_width) || ($max_height > 1 && $upload_height > $max_height) ) ) {
                $_SESSION['ngen']['ngen-file-errors'][] = str_replace('%{file_name}', $file_name, '<em>%{file_name}</em> is too large <strong>Allowed: '.$max_width.' x ' .$max_height. 'px</strong>');
                
                // Delete the image
                unlink($upload_path . $file_name);
                
                return false;
            }
            // END JOE MOD

Then around the (new) line 714 I added this:

// JOE MOD
            $this->upload_prefs['max_width'] = $query->row['max_width'];
            $this->upload_prefs['max_height'] = $query->row['max_height'];
            // END JOE MOD

This now deletes the image from the server after upload if it is too big.

Now on to the second part of my findings + memory limit solution

I looked into my server’s log and found I was getting this error that many people get:

“PHP Fatal error: Out of memory (allocated 31719424) (tried to allocate 11200 bytes) in /home/sites/{site}/public_html/system/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 842”

I tried many ways to fix this like setting these in my .htaccess file: php_value memory_limit / php_value upload_max_filesize / php_value post_max_size

Or these in my php.ini file as suggested: file_uploads / upload_max_filesize / max_input_time / memory_limit / max_execution_time / post_max_size

None of them worked until I added this to my .htaccess file: RLimitMem 128000000

My nGen File Field now works fine and large image uploads are no longer a problem. I hope this helps some people with the same problem.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
15 years ago
Matt Weinberg's avatar Matt Weinberg

You should email nGen about this, to potentially get it integrated into the next release.

       
Happy Content's avatar
Happy Content
54 posts
15 years ago
Happy Content's avatar Happy Content
Matthew, I managed to fix the problem. I don’t know if this will work for you but here’s what I did: - The out of memory error was only occurring on one weblog. - The nGen File Field was being used as a custom filed in that weblog - I went to my file upload preferences to find out where on the server that custom field was uploading - I found the problem file, a 300dpi image that my client had tried to upload - Every time the nGen extension tried to create a thumb for that image it would choke causing the problem and error message - I copied all of the images from that folder via ftp onto my computer and then deleted them from the server - Went back to the EE control panel and went to publish an article in that weblog - The weblog is now working no erro messages - Resized the large image in Photoshop to 72dpi - Went back to the EE control panel and edited all posts that had an image upped through the custom field - Luckily this was a very small weblog with only 5 entries so this method worked Hope all of that is clear and that it may help you out of a jam! Cheers, Liam

I had this same issue and followed your instructions and it worked. Thanks a lot, I’ve been trying to fix this issue for ages!

       
First 35 36 37 38 39 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.