Wondering why you can't post?
To post, head over to our current forums.
   
5 of 34
5
New Extension: nGen File Field for FieldFrame
Posted: 13 April 2009 07:11 PM   [ Ignore ]   [ # 73 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  183
Joined  10-10-2007
Steve Hurst - 10 April 2009 06:29 PM

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

You can replace the if statement on line 411

if($matches[1]{
$increment 
"_" . ($matches[1] 1);
else {
$increment 
"_1";

with this one

if(count($matching_files) == 1{
$increment 
"_2";
else {
$increment 
"_" . (count($matching_files) + 1);
 Signature 

.
....................................................who we are...what we do...how you benefit

Profile
 
 
Posted: 13 April 2009 07:45 PM   [ Ignore ]   [ # 74 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  552
Joined  03-18-2007
Cem Meric - 13 April 2009 07:11 PM

For those who are having similar error on “if file already exists” such as…You can replace the if statement on line 411

Thank you!

 Signature 

Follow me on Twitter: twitter.com/mrw

Note: I used to be slapshotw on this forum.

Profile
 
 
Posted: 15 April 2009 11:52 AM   [ Ignore ]   [ # 75 ]  
Summer Student
Total Posts:  6
Joined  07-31-2008

Any reason why this wouldn’t work, when the normal EE file upload works without errors?

Specifically, I am getting an error like “There was a problem uploading ‘filename.jpg’.” every time. Permissions are all set correctly.

Incidentally, this also occurs with Mark Huot’s File extension. Same error (very general in nature).

I have a feeling this might be related to being on a Windows/IIS host, but the regular EE file upload feature works just fine.

Any ideas?

Profile
 
 
Posted: 15 April 2009 07:17 PM   [ Ignore ]   [ # 76 ]  
Grad Student
Avatar
Rank
Total Posts:  93
Joined  09-18-2008

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

 Signature 

///////////////////////////////////////////////////////////////////////
+ Fred Boyle
+ nGen Works
///////////////////////////////////////////////////////////////////////

Profile
 
 
Posted: 15 April 2009 08:36 PM   [ Ignore ]   [ # 77 ]  
Lab Assistant
RankRank
Total Posts:  153
Joined  11-19-2008

Yes, this extension is fabulous!

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?

Thanks again for the great extension.

Profile
 
 
Posted: 15 April 2009 08:45 PM   [ Ignore ]   [ # 78 ]  
Grad Student
Avatar
Rank
Total Posts:  93
Joined  09-18-2008

@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).

 Signature 

///////////////////////////////////////////////////////////////////////
+ Fred Boyle
+ nGen Works
///////////////////////////////////////////////////////////////////////

Profile
 
 
Posted: 15 April 2009 08:51 PM   [ Ignore ]   [ # 79 ]  
Lab Assistant
RankRank
Total Posts:  153
Joined  11-19-2008

Ah, thanks Fred.  That makes perfect sense.

I was getting confused with some of the settings on MH File, and forgetting how those EE max dimensions setting actually work.

I will make use of the imgsizer plugin.  Thanks again.

Profile
 
 
Posted: 16 April 2009 10:14 AM   [ Ignore ]   [ # 80 ]  
Summer Student
Total Posts:  9
Joined  06-28-2006

Hello all,

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.

<link rel="stylesheet" type="text/css" href="http://localhost/blog/system/extensions/filetypes/ngen_file_field/styles/ngen_file_field.css" charset="utf-8" /> 

ExpressionEngine Core 1.6.7 - Build:  20090320
Fieldframe v.1.0.5
nGen File Field 0.9

I have disabled other extensions to see if that was a conflict ... no luck

Here is a screnshot of the edit page. Definitely looks like a css problem, but the css file is there ... can anyone help ?

Image Attachments
ngenfile_screenshot.jpg
Click thumbnail to see full-size image
Profile
 
 
Posted: 16 April 2009 11:59 AM   [ Ignore ]   [ # 81 ]  
Grad Student
Avatar
Rank
Total Posts:  93
Joined  09-18-2008

@Polar Foundation Looks like it’s unable to locate the CSS file. If you put in the URL for the CSS file, as you posted, in a browser does it find it?

 Signature 

///////////////////////////////////////////////////////////////////////
+ Fred Boyle
+ nGen Works
///////////////////////////////////////////////////////////////////////

Profile
 
 
Posted: 16 April 2009 03:02 PM   [ Ignore ]   [ # 82 ]  
Summer Student
Total Posts:  9
Joined  06-28-2006

Hello there,

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 red face and thanks for the extension ! Must be too tired ...

Thank you for the quick reply and sorry again for bothering you

Profile
 
 
Posted: 17 April 2009 03:10 PM   [ Ignore ]   [ # 83 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  491
Joined  01-23-2006

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.

Any ideas?

{exp:weblog:entries weblog="fa" limit="1" author_id="CURRENT_USER" disable="categories|pagination|member_data|trackbacks"}
                
<div class="consult"><p>{title}{fa-company}</p></div>
                <
div class="secure-box">
                    <
h2>Clients</h2>
                    <
div class="company">
                        <
h3>{fa-client-1}</h3>
                        <
div class="company-box">

                            <
ul>
                                                      
{fa-client-1-docs}
                                
<li><a href="{fa-client-1-file}">{fa-client-1-title}</a></li>
                             
{/fa-client-1-docs}
                            
</ul>
                        </
div>
                    </
div>
                </
div>
{/exp:weblog:entries} 

Attached is a screenshot of my field settings.

Thanks

Image Attachments
Picture 2.png
Click thumbnail to see full-size image
Profile
 
 
Posted: 21 April 2009 10:33 AM   [ Ignore ]   [ # 84 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1674
Joined  03-26-2006

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?

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 21 April 2009 11:17 AM   [ Ignore ]   [ # 85 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  253
Joined  03-07-2007

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

$x = array( ‘filename’ => ‘the_filename.pdf’);
echo serialize($x);

Profile
 
 
Posted: 21 April 2009 03:54 PM   [ Ignore ]   [ # 86 ]  
Grad Student
Rank
Total Posts:  72
Joined  04-19-2009

Will nGen work with SAEF? If not, are there any plans in the works to offer this functionality?

Profile
 
 
Posted: 21 April 2009 11:28 PM   [ Ignore ]   [ # 87 ]  
Grad Student
Avatar
Rank
Total Posts:  93
Joined  09-18-2008

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

 Signature 

///////////////////////////////////////////////////////////////////////
+ Fred Boyle
+ nGen Works
///////////////////////////////////////////////////////////////////////

Profile
 
 
Posted: 22 April 2009 04:30 AM   [ Ignore ]   [ # 88 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  253
Joined  03-07-2007

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 ?

Image Attachments
ffmatrix-to-file.jpg
Click thumbnail to see full-size image
Profile
 
 
Posted: 22 April 2009 07:23 AM   [ Ignore ]   [ # 89 ]  
Grad Student
Avatar
Rank
Total Posts:  93
Joined  09-18-2008

@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. smile

 Signature 

///////////////////////////////////////////////////////////////////////
+ Fred Boyle
+ nGen Works
///////////////////////////////////////////////////////////////////////

Profile
 
 
Posted: 22 April 2009 07:43 AM   [ Ignore ]   [ # 90 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  253
Joined  03-07-2007

that would roxor like a trogdor

Profile
 
 
   
5 of 34
5
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 138922 Total Logged-in Users: 94
Total Topics: 99624 Total Anonymous Users: 27
Total Replies: 501072 Total Guests: 346
Total Posts: 600696    
Members ( View Memberlist )