3 of 6
3
LG SAEF File Upload…. Throwing my hat into the ring
Posted: 25 June 2008 03:02 PM   [ Ignore ]   [ # 37 ]  
Grad Student
Avatar
Rank
Total Posts:  82
Joined  06-05-2002

Leevi, I can’t tell you how much I’m looking forward to using this extension! The timing is just perfect. I’ll let you know how it goes.

Profile
 
 
Posted: 25 June 2008 06:01 PM   [ Ignore ]   [ # 38 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

Great… all feedback is super important… Just be aware that this extension does not allow you to delete a file ... yet smile

 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: 27 June 2008 02:04 AM   [ Ignore ]   [ # 39 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  347
Joined  04-23-2008

Leevi,

Finally gave your plugin a shot. Initially, I was having trouble uploading to a directory, but once I switched it to another one, I logged in through FTP and found the files there. smile

Problem is, when I went to “Edit” and checked out the entries, the custom field I used for the file was not updated and was left blank.

I used this code for the SAEF, pretty much what you supplied in your initial post.

{exp:weblog:entry_form weblog="upload" lg_saef_file_upload="y" lg_saef_file_upload_dir_id="3"}
<p><input type="text" name="title" id="title" value="{title}" /></p>
<
div>
<
input type="file" name="field_id_12" value="" />
</
div>
<
input type='submit' value='submit' />
{/exp:weblog:entry_form}

If it’s any consolation, I’m running ExpressionEngine 1.6.4.. Fields are uploading, just the field isn’t populated when I hit “Edit”.

Just to be clear on how this works.. I created a custom weblog field and made the the field type “Text Input” and popped a 384 character limit on it. After it’s created, I check the field_id for the designated field and apply that to the “name” of the field in an SAEF? Also, just inacse you need to know, I just updated to the newest version of EE and am attempting this upload as a Super Admin.

Cheers,
Danny

 Signature 

Danny, your poor-man’s EE designer for hire/help.

Profile
 
 
Posted: 27 June 2008 02:39 AM   [ Ignore ]   [ # 40 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

Hmmm not sure whats going on…

Heres my test template:

<h1>New Entry</h1>
{exp:weblog:entry_form
    weblog
= "upload_test"
    
lg_saef_file_upload = "y"
    
lg_saef_file_upload_dir_id = "1"
}
    
<label>Title: <input type="text" name="title" value="" /></label><br />
    <
label>File 1: <input type="file" name="field_id_224" value="" /></label><br />
    <
label>File 2: <input type="file" name="field_id_225" value="" /></label><br />
    <
input type='submit' value='Submit' />
{/exp:weblog:entry_form}

{exp
:weblog:entries}
<h1>Edit Entry {entry_id}</h1>
{exp:weblog:entry_form
    weblog
= "upload_test"
    
lg_saef_file_upload = "y"
    
lg_saef_file_upload_dir_id = "1"
}
    
<input type="hidden" name="entry_id" value="{entry_id}" />
    <
input type="hidden" name="entry_date" value="{entry_date format='%Y-%m-%d %g:%i %A'}" />
    <
div><label>Title: <input type="text" name="title" value="{title}" /></label><br /></div>
    <
div><label>File 1: <br />[img  src='{upload_path_1}']<br /><input type="file" name="field_id_224" value="" /></label></div>
    <
div><label>File 2: <br />[img src='{upload_path_1}']<br /><input type="file" name="field_id_225" value="" /></label></div>
    <
input type='submit' value='Submit' />
{/exp:weblog:entry_form}
{
/exp:weblog:entries}

Try give that a whirl and see if anything different happens…

upload_path_1 and upload_path_2 are my custom fields

 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: 27 June 2008 02:48 AM   [ Ignore ]   [ # 41 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

Ok just picked it up… you need a entry_id and entry_date hidden input…

<input type="hidden" name="entry_id" value="{entry_id}" />
<
input type="hidden" name="entry_date" value="{entry_date format='%Y-%m-%d %g:%i %A'}" />

That shoul sort out your edit from.

Over and out… I’m off to drink some beers smile

 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: 27 June 2008 02:53 AM   [ Ignore ]   [ # 42 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  347
Joined  04-23-2008

Leevi,

Thanks for the quick reply!

I’ve used the majority of your code provided (with one upload field rather than 2) and it still doesn’t seem to be populating the Text Input field that the ID corresponds to. When I upload a file, is my understanding correct in that it would automatically populate the field with something like this, {filedir_3}Image.jpg?

The images seem to upload fine, but they aren’t “sticking” to its respective field. Can’t really say what’s up, the usage is pretty self-explanatory, and the Change Logs in EE 1.6.4 doesn’t seem to far out there. Have you managed to get this working with 1.6.4?

UPDATE #1: Just saw your reply after I posted. I’ll take a look at that. By the way, when I mean “Edit”, I mean Edit as in the back-end administration panel rather than a Stand-Alone “Edit” Form. Will keep you posted.

UPDATE #2: Can’t seem to determine the cause. The files are certainly being uploaded to the specified directory without issues. Has anyone experienced issues with 1.6.4? I’m using the most generic SAEF as possible with the only custom field being dedicated to LG SAEF File Upload, but can’t seem to get the field to populate even though the file gets processed.

 Signature 

Danny, your poor-man’s EE designer for hire/help.

Profile
 
 
Posted: 02 July 2008 06:50 PM   [ Ignore ]   [ # 43 ]  
Grad Student
Avatar
Rank
Total Posts:  83
Joined  04-03-2008

I’m having the same problem as Danny. The file uploads but the field doesn’t get populated.

Here’s the pertinent part of the code:

{exp:weblog:entry_form weblog="the-weblog" return="sundry/enter-post" lg_saef_file_upload = "y" lg_saef_file_upload_dir_id = "1"}
<input type="text" name="title" id="title" value="{title}">
<
input type="hidden" name="entry_date" value="{entry_date}">
<
input type="file" name="weblog-image" value="">
<
input type="submit" name="submit" value="Submit">
{/exp:weblog:entry_form}

Also tried with a hidden entry_id field as suggested above; but I’m only working with an entry - not edit - form, so I’m not sure if I need it. In any event, its presence or absence didn’t make a difference.

I too am on 1.6.4. And, just so everything’s clear, the weblog/section I’m working with happens to be called the-weblog (it’s the blog on a site with many other sections) and the custom field ID actually is weblog-image.

Also, when I used the date format that was suggested earlier in the thread for the hidden date field, EE wouldn’t accept my entry, so I changed it to the default.

Thanks,
Nathan

Profile
 
 
Posted: 02 July 2008 06:53 PM   [ Ignore ]   [ # 44 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

Hey Nathan,

Your file input name attribute must be the field_id not its short name. Give that a go.

Cheers

 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: 02 July 2008 07:06 PM   [ Ignore ]   [ # 45 ]  
Grad Student
Avatar
Rank
Total Posts:  83
Joined  04-03-2008

Leevi, you rock. That did it. It’s working like it should.

After spending all day wading through gigantor threads, trying out a few things, and finally deciding everything available was too complicated and I’d wait to see what 2.0 had to offer before letting users upload files, I stumbled upon this. Simple, elegant, to the point.

One quick question: I had to go into the SQL Manager and look at exp_weblog_fields to find the field_id. Is it anywhere in the “normal” part of the control panel?

Thanks a million,
Nathan

Profile
 
 
Posted: 02 July 2008 07:08 PM   [ Ignore ]   [ # 46 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

You can find it in a couple of places… I just look at the URL when I edit a custom field.

Glad it works… Now if we can only figure out dannys problem :(

@Danny, can you double check your field_id?

Cheers Guys

 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: 02 July 2008 07:13 PM   [ Ignore ]   [ # 47 ]  
Grad Student
Avatar
Rank
Total Posts:  83
Joined  04-03-2008

I just look at the URL when I edit a custom field.

Aha! Fabulous.

Thanks again,
Nathan

Profile
 
 
Posted: 02 July 2008 07:29 PM   [ Ignore ]   [ # 48 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  347
Joined  04-23-2008

Leevi,

Haven’t played around with this for a while.. But I did a clean install and everything seems to be working as advertised.. Weird.

Thanks for the great upload! Now if only I can somehow figure out how to pull off an AJAX preview. smile

 Signature 

Danny, your poor-man’s EE designer for hire/help.

Profile
 
 
Posted: 02 July 2008 07:32 PM   [ Ignore ]   [ # 49 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

YAY!!!! That’s two confirmed… seems like we have a winner. smile

 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: 02 July 2008 07:38 PM   [ Ignore ]   [ # 50 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  347
Joined  04-23-2008

Thanks for the great work man.. Without your modules, I wouldn’t be anywhere near as efficient (or inefficient, however you look at it.. Either way, it’s better than had I not had them). smile This is great.. I can’t believe it took so long for someone to push something out like this, but I’m glad you took a stab at it man!

 Signature 

Danny, your poor-man’s EE designer for hire/help.

Profile
 
 
Posted: 02 July 2008 07:42 PM   [ Ignore ]   [ # 51 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

It wasn’t really a hard extension to build but it has laid the ground work for something new and exciting I’m working on. Cna’t say much now… but its coming along nicely

 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: 02 July 2008 07:48 PM   [ Ignore ]   [ # 52 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  347
Joined  04-23-2008

You devil.. I knew you had something up your sleeve that I’ll likely end up using. smile

 Signature 

Danny, your poor-man’s EE designer for hire/help.

Profile
 
 
Posted: 03 July 2008 01:05 AM   [ Ignore ]   [ # 53 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  596
Joined  12-10-2006

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

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

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.

Profile
 
 
   
3 of 6
3
 
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: 64915 Total Logged-in Users: 18
Total Topics: 81870 Total Anonymous Users: 23
Total Replies: 440145 Total Guests: 174
Total Posts: 522015    
Members ( View Memberlist )
Newest Members:  Suman KumarsmilepolitelyrvmcleodbjmohrAqua193Bios Elementmjpoteetguimogranwelshmrcf