Great addon, this field seems to work perfectly for me except for one issue - if the file already exists, I get a PHP “can’t write headers” error on publish. It seems that everything works, and it creates a derivative file, and displays in my weblog, but I think this error could scare my client if they ever run into a similar situation.
For those who are having similar error on “if file already exists” such as
Notice: Undefined offset: 1 in C:\EE_install_folder\system\extensions\fieldtypes\ngen_file_field\ft.ngen_file_field.php on line 411
@Steve Hurst Could you PM me details on your environment (IIS/Apache, PHP version, EE version+build), also URL + login info if possible?
@Cem Meric thanks for sharing that quick fix.
@BWC Scott If both nGen File Field and Huot File fail then there’s a larger issue that seems related to your environment. If you can PM me URL + login info I can take a look when I have a moment.
I have a question regarding max image size settings in file upload preferences. I hope that other users will be able to confirm if this works for them or not.
I’m noticing that when I upload images they are not being sized according to the settings in my file upload preferences. It might just be me, but I’ve done several tests, and the images are staying at original size.
Does nGen File Field follow the max dimensions set in weblog file upload preferences?
@riley That is expected behavior at this time. nGen File Field only follows the type (img or anything) and file size settings. We use the imgsizer plugin to resize images. Also in normal use those settings wouldn’t resize the image but prevent an image that was larger from being uploaded at all (more info).
I am trying to use nGen File Field in standalone mode (not in the FF matrix). Everything went fine on the install and files are uploaded as expected but there seem to be a CSS problem since, in my edit page, the picture is displayed in its original size and I do not see the suppress button (text instead of image replacement I think).
Is this a path problem ? Running on WAMP on localhost (sandbox install). I cannot figure out what happens here. I have a <link> element calling the CSS with an absolute path that looks correct compared to my local install.
Nope. Didn’t see it in browser. After a bit of fiddling, I disovered I was the culprit here, not the extensions. <blush class=“ultra”>Typo in FieldFrame URL settings</blush>. See the path above ... it should read /extensions/fieldtypes/ and not /extensions/filetypes/ in the path. Sorry about that and thanks for the extension ! Must be too tired ...
Thank you for the quick reply and sorry again for bothering you
For some reason I can’t get the tag pair to output anything using FF matrix and ngen file. The single tag outputs the table array as expected but I get nothing from the tag pair. Can’t figure out what I’m doing wrong.
Has anyone had a problem converting an old MH File field to this nGen version? I had a File custom field with about 14 entries. Everything in those is stored just like this: “filename.pdf”. I converted the field to nGen File, and we uploaded a file no problem, but the info is stored in an array, like this: “a:1:{s:9:“file_name”;s:35:“IC_Whitepaper_OptimizeEdDesigns.pdf”;}”
The problem is when we go to edit one of the entries that had a previously uploaded file…nGen file doesn’t know what to do with that field, and throws errors in the CP. Example:
Warning: getimagesize(/home/client/public_html/uploads/pdf/I) [function.getimagesize]: failed to open stream: No such file or directory in /home/client/public_html/system/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 183
Has anyone else run into this? Why is the nGen file stored as an array? How can I convert the previously uploaded entries?
@mdesign: i’m guessing nGen-file uses array because of that is how it is used by fieldframe
Depending on the amount of data, you could probably write a small
conversion script and serialize the data. put the current filename in an array and serialize it.
@fodney Looking at your template code and the screenshot you should replace {fa-client-1-file} with {client-1-file} and {fa-client-1-title} with {client-1-title} and that should fix it.
@Mdesign & @GDmac I’m working to resolve the array + MH File compatibility along with other enhancements. Keep an eye out I’m hoping to release an update by the end of next week.
@anthonys This is more of a FieldFrame question so this may need to be asked in that thread. However I don’t think FieldFrame is SAEF friendly so neither would the nGen File fieldtype.
Thanks Fred for the info. to add to mDesign’s request, i have
aa FF-Matrix field where i would like to change the current
filenames to an Ngen-upload button. (see attached image)
However that would be a little more tricky array to array conversion.
@mDesign, Brandon posted a php-script to copy field-data to a gypsy field,
which could be adapted to convert your data. i suggest, first testing it out on
a dummy field. http://expressionengine.com/forums/viewreply/505640/
@nGen Fred, are you also considering an option to be able to select
previously uploaded images ?
@GDmac The field will no longer store things in an array so your conversion should be effortless. Also, yes I am considering the selection of previously uploaded images, not sure if it will be in the next release however. Stay tuned.