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

horizonvp's avatar
horizonvp
107 posts
15 years ago
horizonvp's avatar horizonvp
Any updates on the upload limitations for the folder be respected? Thanks!

Not having this feature makes it all too easy for clients to “break” things. Anyone have a workaround solution? Anyone from nGen care to reply with a real solution?

       
MotoNomad's avatar
MotoNomad
32 posts
15 years ago
MotoNomad's avatar MotoNomad

I’m still having an issue with nGen FileField’s ability to rename/ apend a filename if it alreasy exists. It works fine until the 10th iteration, when it starts overwriting the file , _1, _2, _3… _9, _10, _10, _10…. (see my first post on this a few posts up) This creates problems.

Here is the relevant code from ft.ngen_file_field.php. This looks like a RegEx issue. Any suggestions for fixing this?

// Check if file exists already, if it does add an increment to the file name
if( file_exists($upload_path . $file_name) ) {
    $matching_files = glob($upload_path . $file['name'] . "*" . $file['ext']);

    // Find highest number, add 1 and set new $file_name
    sort($matching_files);
    preg_match("/" . $file['name'] . "_(\d+)\." . substr($file['ext'], 1) . "/", basename(end($matching_files)), $matches);
    
    if( isset($matches[1]) && $matches[1] ) {
        $increment = "_" . ($matches[1] + 1);
    } else {
        $increment = "_1";
    }
    
    $file_name = $file['name'] . $increment . $file['ext'];
    //
}
//

Thanks!

       
David Dexter's avatar
David Dexter
88 posts
15 years ago
David Dexter's avatar David Dexter

I also would love a way to remove the “Choose existing file” feature. We are stress testing the file upload for a large scale intranet and the SAEF completely fails once the file count in the directory gets very large.

       
NKT com's avatar
NKT com
124 posts
15 years ago
NKT com's avatar NKT com
I also would love a way to remove the “Choose existing file” feature. We are stress testing the file upload for a large scale intranet and the SAEF completely fails once the file count in the directory gets very large.

+1 I would also love this.

       
Ruud L. Heerkens's avatar
Ruud L. Heerkens
45 posts
15 years ago
Ruud L. Heerkens's avatar Ruud L. Heerkens

@dpdexter & NKT com

Use some magic in your SAEF to do the above:

[removed]
    $(document).ready(function() {
        $('.ngen-file-choose-existing').hide();
    });
[removed]
       
David Dexter's avatar
David Dexter
88 posts
15 years ago
David Dexter's avatar David Dexter

Thanks Ruud but that didn’t really work for use since there are 3000 files in the target directory. I went ahead and updated the extension so that the files aren’t all written to the page in the select.

       
NKT com's avatar
NKT com
124 posts
15 years ago
NKT com's avatar NKT com

Is there a similar way to stop it inside the EE control panel? Will that Javascript also stop it loading on the thumbnails into memory?

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

Whoa…absolutely awesome extension. I am using the file upload with matrix. I notice that the file upload returns a relative path that has a leading slash. I always use absolute paths for links so that they never break even when I have some segment variables on the end of the url.

Is there a way to control the output to not include the leading slash so I could use: {site_url}{file}

or

Include the site url?

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

Ooops. One other question. Is there somewhere that documents all the parameters and variables other than: http://www.ngenworks.com/software/ee/ngen-file-field/

I see that there is the parameter show=”filename” added on 0.9.9. Is that the only parameter? Am I missing something or is that all the parameters?

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

I’ve just started to use the nGen File Field extension. Unfortunately, I have a problem with image thumbnails.

On publishing an entry, the image selected in the File Field is correctly uploaded to the relevant upload directory. The extension also creates the “thumbs” subdirectory. But no thumbnail is generated, so nothing is displayed in the edit form.

As far as I know, I have all the necessary requirements for the extension to work (jQuery for CP and FieldFrame. Permissions on the image directories are set to 777.

Any ideas why the thumbnails aren’t created? Is there another requirement I’ve missed?

Many thanks.

       
Chadman's avatar
Chadman
10 posts
15 years ago
Chadman's avatar Chadman
I’m still having an issue with nGen FileField’s ability to rename/ apend a filename if it alreasy exists. It works fine until the 10th iteration, when it starts overwriting the file , _1, _2, _3… _9, _10, _10, _10…. (see my first post on this a few posts up) This creates problems.

MotoNomad,

The RegEx on the nGen File Field looks fine, but their logic is a little off. When the ft.ngen_file_field.php runs it looks for a file name match and then determines the highest numbered file name by sorting an array of matches and grabbing the last item from the list. Everything works fine until you hit double digits at which point the sort method returns an alphabetical list like this:

file.jpg file_1.jpg file_10.jpg file_2.jpg file_3.jpg file_4.jpg file_5.jpg file_6.jpg file_7.jpg file_8.jpg file_9.jpg

What you want is the natural sort order:

file.jpg file_1.jpg file_2.jpg file_3.jpg file_4.jpg file_5.jpg file_6.jpg file_7.jpg file_8.jpg file_9.jpg file_10.jpg

The problem is on line 554 of ft.ngen_file_field.php (I’m looking at v0.9.10). Just replace line 554’s

sort($matching_files);

with

natsort($matching_files);

and your are in business.

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

It would seem that my problem is the same as this one; that is, the file name for the thumbnail in the control panel is being placed outside of the image’s src attribute:

<a href="http://www.example.com/images/uploads/440x250-01.jpg%22class=%22ngen-file-link" class="ngen-file-link" target="_blank" rel="noopener">_http://www.example.com/images/uploads/_440x250-01.jpg_</a>

And shouldn’t the src be to the thumbs subdirectory?

Is this a known issue? Is there a cure? Have tried removing and reinstalling the extension but to no avail. All help gratefully received.

       
David Dexter's avatar
David Dexter
88 posts
15 years ago
David Dexter's avatar David Dexter

@FullCremMilkMan - Do you have a ‘sized’ directory in your uploads folder? That is where the resized images are cached. Make sure that you have the permissions set to 777 on the uploads directory.

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

@dpdexter: I don’t really know what you mean by a ‘sized’ directory.

I have several distinct upload directories, each with 777 permissions. Images are uploaded correctly, and a ‘thumbs’ directory has been created by nGen File Field. But no thumbnail image is created - the ‘thumbs’ directories are empty - and there’s the problem with the src attribute.

Am I missing another extension (aside from FieldFrame and jQuery for CP) that should be installed for File Field to work? Something for image resizing? The native EE image resizing using GD2 works fine.

       
David Dexter's avatar
David Dexter
88 posts
15 years ago
David Dexter's avatar David Dexter

@FullCremMilkMan - Sorry I meant a ‘sized’ directory in your ‘images’ folder. In your images folder you should have:

/images/sized /images/uploads etc….

The plugin uses the ‘sized’ directory for storing the cached resized images. Can you post your code (just the part where you are calling the plugin) so we can see if there is an issue there?

Thanks, David

       
First 31 32 33 34 35 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.