4 of 6
4
LG SAEF File Upload…. Throwing my hat into the ring
Posted: 06 July 2008 05:56 AM   [ Ignore ]   [ # 55 ]  
Lab Assistant
RankRank
Total Posts:  271
Joined  07-04-2007
mmcclung - 04 July 2008 10:36 AM

Hey, Leevi—

cool functionality, though i’m hitting a speedbump; I can upload a file successfully to right directory, but the custom field entry in my weblog is now

{filedir_3}foo_file.aif

with the curlybraces and all. is this expected behavior?

end goal is to able to {exp:extract_url} the filename for other users to download, but right now that plugin seems to gack on the curlybraces in my custom field.

The {filedir_3} is correct, EE automatically will parse that to display the correct folder.

When you output the custom field to a template does it display “http://www.example.com/upload_folder/filename.ext”? or does it show “{filedir_3}filename.ext”?

have you also tried using extract url plus 2?

Profile
 
 
Posted: 06 July 2008 06:54 AM   [ Ignore ]   [ # 56 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  248
Joined  12-11-2002

it shows “{filedir_3}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=”{filedir_3}”} makes the field presentation-pretty.

big props to leevi for another useful hunk o’ code

Profile
 
 
Posted: 13 July 2008 02:53 PM   [ Ignore ]   [ # 57 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  535
Joined  02-07-2007

Hey Levi,

I am currently using this extension as it is downloaded today.

Here is my form and I am getting “Your section entry must have a title.”

{if logged_out}
                
<h1>Become a Friend</h1>
                
{embed="friends/register_form"}
                {
/if}

                {if logged_in}
                
<h1>Hi {screen_name}!</h1>
                <
p>How goes it?</p>
                <
p>Would you like to <a href="/submit">submit a design?</a></p>
                
                <
div id="saef-holder">
                    
{exp:weblog:entry_form weblog="friend_submissions" return="/worked" status="pending" lg_saef_file_upload = "y" lg_saef_file_upload_dir_id = "1"}
                    
                    
<label>Name of project: <span class="required">*</span></label><br />
                    <
input type="text" name="{title}" value="{title}" class="input" id="{title}" size="40" /><br />
                    
                    <
label>Project Package: </label><br />
                    <
span class="instructions">Zip of project</span>
                    <
input type="file" name="field_id_4" class="input" value=""/><p />
                                    
                    
{custom_fields}
                    
                    {if textinput}
                    
<label>{field_label}: <span class="required">*</span></label><br />
                    <
span class="instructions">{field_instructions} </span>
                    <
input type="text" name="{field_name}" value="" class="input" id="{field_name}" size="40" /><br />
                    
                    
{/if}
                    
                    {if textarea}
                    
<label>{field_label}: <span class="required">*</span></label><br />
                    <
span class="instructions">{field_instructions} </span>
                    <
textarea name="{field_name}" id="{field_name}" rows="{rows}" cols="50">{field_data}</textarea>
                    
{/if}
                    
                    
                    
                    {
/custom_fields}
                    
                    
<input type="submit" name="submit" value="Submit" />
                    
{/exp:weblog:entry_form}

Can you tell me where I am going wrong?

Thanks
-Lee

 Signature 

you’ve got that sexy Canadian thing working for you… - Derek Allard

EkJobs.ca

Clever Andy

http://twitter.com/thatleeguy

Profile
 
 
Posted: 13 July 2008 03:48 PM   [ Ignore ]   [ # 58 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  535
Joined  02-07-2007

Figured it out.

It is conflicting with the custom fields. If I manually input the ids and fields its fine.

Thanks!

-Lee

 Signature 

you’ve got that sexy Canadian thing working for you… - Derek Allard

EkJobs.ca

Clever Andy

http://twitter.com/thatleeguy

Profile
 
 
Posted: 13 July 2008 04:54 PM   [ Ignore ]   [ # 59 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006
Adam George - 03 July 2008 01:05 AM

Leevi - What type of custom field does the custom field have to be? Text?

Yep a text field will be perfect.

 Signature 

VOTE FOR LG Addons in the Mashable Open Web Awards!


Newism - Newcastle Web Design & Development


LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator

Profile
 
 
Posted: 13 July 2008 04:56 PM   [ Ignore ]   [ # 60 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006
mmcclung - 06 July 2008 06:54 AM

it shows “{filedir_3}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=”{filedir_3}”} 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.

 Signature 

VOTE FOR LG Addons in the Mashable Open Web Awards!


Newism - Newcastle Web Design & Development


LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator

Profile
 
 
Posted: 15 July 2008 06:32 AM   [ Ignore ]   [ # 61 ]  
Grad Student
Rank
Total Posts:  41
Joined  09-05-2007

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

Profile
 
 
Posted: 17 July 2008 01:21 PM   [ Ignore ]   [ # 62 ]  
Grad Student
Rank
Total Posts:  55
Joined  02-21-2006

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}

 Signature 

Loracs Creations Inc.
Web Design & Development
http://loracs.com

Profile
 
 
Posted: 20 July 2008 07:10 AM   [ Ignore ]   [ # 63 ]  
Grad Student
Rank
Total Posts:  55
Joined  02-21-2006

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!

 Signature 

Loracs Creations Inc.
Web Design & Development
http://loracs.com

Profile
 
 
Posted: 22 July 2008 02:00 AM   [ Ignore ]   [ # 64 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  596
Joined  12-10-2006

EDITED: My silly mistake.

Profile
 
 
Posted: 23 July 2008 12:45 PM   [ Ignore ]   [ # 65 ]  
Grad Student
Rank
Total Posts:  33
Joined  08-12-2007

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!

Profile
 
 
Posted: 24 July 2008 01:25 PM   [ Ignore ]   [ # 66 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  206
Joined  06-18-2007

Leevi,

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

Thanks….

Profile
 
 
Posted: 24 July 2008 03:39 PM   [ Ignore ]   [ # 67 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

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.

 Signature 

VOTE FOR LG Addons in the Mashable Open Web Awards!


Newism - Newcastle Web Design & Development


LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator

Profile
 
 
Posted: 24 July 2008 03:46 PM   [ Ignore ]   [ # 68 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  206
Joined  06-18-2007

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

Profile
 
 
Posted: 25 July 2008 09:16 AM   [ Ignore ]   [ # 69 ]  
Grad Student
Rank
Total Posts:  55
Joined  02-21-2006

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.

 Signature 

Loracs Creations Inc.
Web Design & Development
http://loracs.com

Profile
 
 
Posted: 28 July 2008 10:04 AM   [ Ignore ]   [ # 70 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  535
Joined  02-07-2007

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

If so I would love to know more!

-Lee

 Signature 

you’ve got that sexy Canadian thing working for you… - Derek Allard

EkJobs.ca

Clever Andy

http://twitter.com/thatleeguy

Profile
 
 
Posted: 01 August 2008 12:25 AM   [ Ignore ]   [ # 71 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  596
Joined  12-10-2006

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.

Profile
 
 
Posted: 01 August 2008 01:03 AM   [ Ignore ]   [ # 72 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

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?

 Signature 

VOTE FOR LG Addons in the Mashable Open Web Awards!


Newism - Newcastle Web Design & Development


LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator

Profile
 
 
   
4 of 6
4
 
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 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64909 Total Logged-in Users: 42
Total Topics: 81853 Total Anonymous Users: 31
Total Replies: 440066 Total Guests: 228
Total Posts: 521919    
Members ( View Memberlist )