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

LG SAEF File Upload.... Throwing my hat into the ring

Development and Programming

markwts's avatar
markwts
38 posts
about 17 years ago
markwts's avatar markwts
Hey Guys, I’m working on a new auto - update extension that should resolve these issues. Cheers

Thanks Leevi - keep up the good work mate 😉

       
Andy Harris's avatar
Andy Harris
958 posts
about 17 years ago
Andy Harris's avatar Andy Harris

Levi, you are the daddy. This is absolutely what I need and it worked first time!

Just made yet another job that much easier. Beers are owed!

       
DaveO's avatar
DaveO
10 posts
16 years ago
DaveO's avatar DaveO

I just found a conflict with this extension (which I love) and Solspace’s onSubmit extension (which I kinda need).

I haven’t seen anyone report this yet, so I figured it might prove helpful. This is the first time I’ve experienced a conflict with extensions.

The Behavior: As soon as the onSubmit extension is enabled, the LG SAEF File Upload extension fails to do anything on the form – the hidden fields and enctype are missing. This is even if onSubmit is not being used on that SAEF form. The form still submits and the data saves, but no file uploads and the custom field will only show the filename, no path var.

I’m not sure what the conflict is exactly…that’ll have to wait.

[edit] I found that by modifying the priority of the onSubmit extension to 9, it can co-exist with the LG SAEF File Upload extension.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

Hey DaveO,

I haven’t checked out Solspaces extension but I would hesitate to guess that it is not checking to see if anyone is modifying the data before the hook is executing the extension method.

Heres an example of my code:

/**
    * Modify the $data parameters before they are processed by the user side form creator
    *
    * @param    array    $data    The form data
    * @return    array            The form data
    * @since     Version 1.0.0
    * @see        http://expressionengine.com/developers/extension_hooks/form_declaration_modify_data/
    */
    function form_declaration_modify_data($data)
    {
        global $EXT, $TMPL;
        // -- Check if we're not the only one using this hook
        if($EXT->last_call !== FALSE) $data = $EXT->last_call;
        
        // check if the $TMPL is an object 
        // on the traditional member pages this hook is called but there are no templates.
        if(is_object($TMPL) === TRUE && $TMPL->fetch_param('lg_saef_file_upload') == 'y')
        {
            $data['enctype']='multi';
            $data['hidden_fields']['lg_saef_file_upload'] = 'y';
            $data['hidden_fields']['lg_saef_file_upload_dir_id'] = $TMPL->fetch_param('lg_saef_file_upload_dir_id');
        }
        return $data;
    }

You can see that I am checking if anyone else is using the hook first. If they are I’m using their data as a base for my extension. You may be able to modify Solspaces extension to do something similar.

Cheers

       
DaveO's avatar
DaveO
10 posts
16 years ago
DaveO's avatar DaveO

Leevi,

You’re exactly right, thanks for the heads up on that.

Dave

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

No worries… don’t forget to notify Solspace on their forum about the issue. 😊

       
DaveO's avatar
DaveO
10 posts
16 years ago
DaveO's avatar DaveO

Yep, I’ve already sent them an email and will follow up in the forums.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

Excellent.

       
smartpill's avatar
smartpill
456 posts
16 years ago
smartpill's avatar smartpill

I’m having the same issue as this one. The directory tag is showing. Seems to have something to do with Mark Hout’s File field which I’m using. I’ve tried switching to a regular text field with no formatting, but it shows in the SAEF, where this doesn’t for some reason.

       
Sasha's avatar
Sasha
85 posts
16 years ago
Sasha's avatar Sasha

Is there any way to get the Edit part of this working in the Admin Panel as well?

I’m using this for a weblog where data is entered via the SAEF, but edited via the normal control panel. And at the moment in the control panel, my SAEF file field just shows up as a text box, with no way to re-upload a file. It’d be great if this had the same functionality in the SAEF as in the control panel!

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
Is there any way to get the Edit part of this working in the Admin Panel as well? I’m using this for a weblog where data is entered via the SAEF, but edited via the normal control panel. And at the moment in the control panel, my SAEF file field just shows up as a text box, with no way to re-upload a file. It’d be great if this had the same functionality in the SAEF as in the control panel!

At the moment there are no plans to add this functionality to the backend CP. Generally I just use the normal file upload which works well although it does not provide a preview. :(

       
smartpill's avatar
smartpill
456 posts
16 years ago
smartpill's avatar smartpill

For some reason, the “browse” button (or my form “submit” button, for that matter) isn’t clickable in Firefox 2 for Windows. I haven’t been able to test on a Mac, but FF3 works fine. Has anyone else experienced this or have a clue what the fix might be?

       
Joobs's avatar
Joobs
362 posts
16 years ago
Joobs's avatar Joobs

BUG: If a user doesn’t supply a required field or the title the file uploads anyway and then the form throws out an error. So then the user fills the required field and the file gets duplicated on the server again when they click submit. This is a problem for me because i’m using this to upload fairly large files.

Anyone have any ideas how this can be fixed?

       
Jaycee's avatar
Jaycee
16 posts
16 years ago
Jaycee's avatar Jaycee

Let me first say that I really love this extension. I first implemented it several weeks ago, and it has been working great except for this little problem…

If a user uploads a file with a space in it, such as “My File.doc”, EE converts the filename to “My_File.doc” but the extension still saves “My File.doc” to the database. Is there anyway to get the data saved to the database by the extension to go through the same filename encoding as the actual file that was uploaded?

       
Joobs's avatar
Joobs
362 posts
16 years ago
Joobs's avatar Joobs
Let me first say that I really love this extension. I first implemented it several weeks ago, and it has been working great except for this little problem… If a user uploads a file with a space in it, such as “My File.doc”, EE converts the filename to “My_File.doc” but the extension still saves “My File.doc” to the database. Is there anyway to get the data saved to the database by the extension to go through the same filename encoding as the actual file that was uploaded?

If i upload “my file.xyz” through a SAEF the extension saves it as “my_file.xyz” to the server, and in the database/weblog field it’s stored as “https://ellislab.com/asset/images/team-photo/my_file.xyz”.

So it does what you want it to do for me!

       
First 5 6 7 8 9

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.