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

Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham
it shows “https://ellislab.com/asset/images/ent-partner-work/filename.ext” {exp:ee_typography format=none} extracts the URL successfully (not sure why {exp:extract_url} failed, but there you go). {exp:phpstringfun function="ltrim" par1="https://ellislab.com/asset/images/ent-partner-work/"} makes the field presentation-pretty. big props to leevi for another useful hunk o’ code

I think I will make an option in the final release to include the {filedir} prefix. It could get confusing tho if you change your mind half way through and some of your older images break.

Then again the two plugin solutions seem like an easy way to keep consistency.

       
mediavilla's avatar
mediavilla
79 posts
17 years ago
mediavilla's avatar mediavilla

Hi Levy,

I’m running EE v 1.6.3 with MSM 1.0 on PHP 4.4.8. I’ve been trying to use the extension and it doesn’t upload the file but it does insert the data into the weblog/database.

The code:

{exp:weblog:entry_form weblog="gstupload" return="/TG/upload" lg_saef_file_upload="y" lg_saef_file_upload_dir_id="8"}
<input type="text" name="title" id="title" value="{title}">
<input type="hidden" name="entry_date" value="{entry_date}">
<input type="file" name="field_id_50" value="">
<input type="submit" name="submit" value="Submit">
{/exp:weblog:entry_form}

I’ve created a new upload destination (id=8) and if I have:

<input type="file" name="50" value="">

it doesn’t copy the value into the weblog.

So, I’m doing:

<input type="file" name="field_id_50" value="">

And that works to send the content to the DB.

Also, I have an .htaccess file to hide index.php in the URL but I don’t know if that can be related.

Any help will be welcome,

Many thanks,

Juan

       
PDM's avatar
PDM
61 posts
17 years ago
PDM's avatar PDM

Hi Leevi,

Looks like a great plug in, and after looking at a lot of options, am excited to get this working, but am running into a problem. I’m using the following code and it’s successfully uploading the file to the correct directory, but after hitting the submit button, I get a blank page (same URL as the submit form), and none of the info gets written to the database from either the select list field or the file field. Any ideas what might be going?

Also, if I just select one of the options in the select list and don’t upload a file, a weblog entry is successfully created.

Thanks for tackling this Leevi!

Paula

p.s. EE 1.6.1; PHP 5.2.0; MySQL 4.0.27

{exp:weblog:entry_form weblog="{my_weblog}" return="/postthanks" name="productform" lg_saef_file_upload = "y" lg_saef_file_upload_dir_id = "1"}

<label for="field_id_13">Product Type
<select name='field_id_13' class='select' >
<option value='Flooring' dir='ltr' >Flooring</option>
<option value='Lumber' dir='ltr' >Lumber</option>
<option value='Molding' dir='ltr' >Molding</option>
<option value='Natural-edge boards' dir='ltr' >Natural-edge boards</option>
<option value='Other' dir='ltr' >Other</option>
</select>
</label>


<label for="field_id_14">Upload Photo
<input type="file" name="field_id_14" value="" />
</label>


<input type="submit" name="submit" value="Submit" id="submitbutton"/>

<input type="hidden" name="title" value="prod<?php date_default_timezone_set('UTC'); echo date('ymd'); ?>" />
<input type="hidden" name="url_title" value="{url_title}" />
<input type="hidden" name="status" value="closed" />
<input type="hidden" name="entry_date" value="{entry_date}">
<input type="hidden" name="field_ft_13" value="none" /> 
<input type="hidden" name="field_ft_14" value="none" /> 

{/exp:weblog:entry_form}
       
PDM's avatar
PDM
61 posts
17 years ago
PDM's avatar PDM

Juan, did you ever figure out what was going on? Am still trying to resolve the blank page/failure to populate fields problem and would love to get this working. Anybody run in to a similar situation and resolved it? Thanks!

       
Adam George's avatar
Adam George
283 posts
17 years ago
Adam George's avatar Adam George

EDITED: My silly mistake.

       
wecreateyou's avatar
wecreateyou
86 posts
17 years ago
wecreateyou's avatar wecreateyou

This plugin worked great meaning it did what i was supposed to. However, I can not load my control panel with it installed. I had to disable all extensions in the .config file to get in. Once inside the CP I enabled all extensions with the “enable button”, after which I disabled the the LG SAEF File Upload using the disable link.

Note: Simply deleting the extension didn’t work because the Control Panel would still look for the missing ext. file. It took a while of trial and error to figure that out.

I love the extention because it was working until I realized the next day that I couldn’t get in the CP. I have purchased from LG and use other LG stuff. Thanks for all your contributions to the EE world. I’m fast becoming an EE Addict!

       
JCI's avatar
JCI
144 posts
17 years ago
JCI's avatar JCI

Leevi,

Will this work if allowing multiple upload fields on one SAEF? We’ve run into troubles with multiple uploads with other extensions.

Thanks….

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

Yeah it should work for multiple file uploads… but only if each file has its own custom field. This extension will not support multiple uploads for the same field.

       
JCI's avatar
JCI
144 posts
17 years ago
JCI's avatar JCI

That sounds perfect…. thank you. If we have any more questions, we’ll let you know.

       
PDM's avatar
PDM
61 posts
17 years ago
PDM's avatar PDM

For anyone running into a blank screen when they try to upload a file, you might want to check out this thread. It worked for me, although it might not be an ideal solution for every site, given the security issues.

       
CI Lee's avatar
CI Lee
343 posts
17 years ago
CI Lee's avatar CI Lee

Has anyone attempted to port this to allow upload to S3?

If so I would love to know more!

-Lee

       
Adam George's avatar
Adam George
283 posts
17 years ago
Adam George's avatar Adam George

Leevi, does the extension go through EE’s normal security checks, filtering, etc?

The reason I ask is that in my file upload prefs I have set it to images only, but was able to upload a textfile saved with a jpg extension.

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

Yep it should. It uses EE’s native upload object which does all the checks. Can you upload a text file with a .jpg extension using the file upload box in the admin?

       
project_digital's avatar
project_digital
37 posts
about 17 years ago
project_digital's avatar project_digital

where can I download your latest file upload extention? This is exactly what I need. When it populates the field, does it embed the file or puts the url in the field?

Thanks

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
about 17 years ago
Leevi Graham's avatar Leevi Graham
where can I download your latest file upload extention? This is exactly what I need. When it populates the field, does it embed the file or puts the url in the field? Thanks

The latest version can be found attached to my first post.

       
First 3 4 5 6 7 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.