1 of 38
1
File
Posted: 06 October 2006 12:02 PM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  01-05-2006

Hello, all
This extension places a simple file field on the publish page and allows the user to upload images/documents to the field.  It uses the existing upload directories defined and takes their settings, so file type and size restrictions should be valid.  Currently there is not an error system, because of the way EE runs it’s output, but i’ll look into something soon.  Also you should know that the extension requires JS if you want to remove an image.  Without JS it can not be done.

Finally.  The “icons” folder goes in your default “images” folder next to the “uploads” directory.

UPDATE: - I’ve got a 3.x version going on my site, please try that before downgrading to the 2.x branch. Find it here: http://docs.markhuot.com/ee/extensions/file/

File Attachments
ext.file_110.zip  (File Size: 32KB - Downloads: 649)
ext.file_212.zip  (File Size: 92KB - Downloads: 665)
 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 06 October 2006 12:33 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
RankRankRank
Total Posts:  970
Joined  06-13-2005

I installed File (v.1.0.0) in EE Core, but I see no file field in the form:

CP Home ›  Publish ›  New Entry

Where to look for it?

Thanks.

 Signature 

tulks.com

Profile
 
 
Posted: 06 October 2006 12:34 PM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  01-05-2006

You’ll have to add it as a field the same way you would add a new text field or date field under Admin > Weblog Administration > Custom Fields > Field Group > Add New Custom Field

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 06 October 2006 12:54 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
RankRankRank
Total Posts:  970
Joined  06-13-2005

Thanks a lot! I understood.

It works now.

But 2 notes:

CP Home ›  Publish ›  New Entry:

Notice: Undefined variable: display in /usr/home/***/system/extensions/ext.file.php on line 296

(PHP5; EE Core)

And a font size problem: 2 screenshots attached, w/ file field, and w/o file field.
(FF/WinXP)

Image Attachments
Capture1.gifCapture2.gif
Click thumbnail to see full-size image
 Signature 

tulks.com

Profile
 
 
Posted: 06 October 2006 01:07 PM   [ Ignore ]   [ # 4 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  01-05-2006

I updated it.  The fix should fix both the notice and the font size.  Upload it up top.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 06 October 2006 01:52 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
RankRankRank
Total Posts:  970
Joined  06-13-2005

Excellent! Thanks a lot!

 Signature 

tulks.com

Profile
 
 
Posted: 06 October 2006 02:49 PM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  01-05-2006

There was an issue with one of my regular expressions which has now been updated.  please download again from the first post.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 06 October 2006 02:53 PM   [ Ignore ]   [ # 7 ]  
Research Assistant
RankRankRank
Total Posts:  970
Joined  06-13-2005

The archive (zip) is broken.

 Signature 

tulks.com

Profile
 
 
Posted: 06 October 2006 02:57 PM   [ Ignore ]   [ # 8 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  01-05-2006

fixed!  it was 0k now it’s 88k, so that should be good.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 06 October 2006 09:36 PM   [ Ignore ]   [ # 9 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  01-05-2006

I’ve updated the ext again to output the full file url when called from the template.  Get it at the top.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 07 October 2006 12:58 AM   [ Ignore ]   [ # 10 ]  
Research Assistant
RankRankRank
Total Posts:  970
Joined  06-13-2005

There’s a serious(?) bug in the extension. Today I have published an article in a weblog that did NOT use the file extension (latest version):

Problems after publishing, but it was published.

I repeated the bug by Edit/Quick Save:

Warning: Invalid argument supplied for foreach() in /usr/home/***/system/extensions/ext.file.php on line 324

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/***/system/extensions/ext.file.php:324) in /usr/home/***/system/core/core.functions.php on line 707

PHP5; the weblog doesn’t use the file field. And I see the font size in the blog in this blog (w/o file field)

 Signature 

tulks.com

Profile
 
 
Posted: 07 October 2006 01:02 AM   [ Ignore ]   [ # 11 ]  
Research Assistant
RankRankRank
Total Posts:  970
Joined  06-13-2005

I created a test entry. Result:

Warning: Invalid argument supplied for foreach() in /usr/home/***/system/extensions/ext.file.php on line 324

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/***/system/extensions/ext.file.php:324) in /usr/home/***/system/core/core.functions.php on line 707

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/***/system/extensions/ext.file.php:324) in /usr/home/***/system/core/core.functions.php on line 293

The entry was published. (This weblog/weblog publish page doesn’t use the file field)

But I don’t see the font size bug now.

 Signature 

tulks.com

Profile
 
 
Posted: 07 October 2006 04:20 AM   [ Ignore ]   [ # 12 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  876
Joined  02-05-2002

Exellent extension Mark, great idea wink

It does need a little bit more work though.

I get the same warnings when I use more than one File field.

Also, Formatting for the File field is set to ‘Xhtml’ by default but should be ‘None’ (you can work around this by creating a text field first, set formatting to ‘None’ and then change field type to ‘File’)

Cheers

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 07 October 2006 08:20 AM   [ Ignore ]   [ # 13 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  01-05-2006

Thanks for the replies guys.  Those bugs should all be fixed now!  Get it again at the top.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 07 October 2006 08:48 AM   [ Ignore ]   [ # 14 ]  
Research Assistant
RankRankRank
Total Posts:  970
Joined  06-13-2005
File Size: 0KB
 Signature 

tulks.com

Profile
 
 
Posted: 07 October 2006 08:55 AM   [ Ignore ]   [ # 15 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  01-05-2006

should be better now.  that’s rather annoying.  I’m using Safari on a mac and the post takes forever to publish, but once it goes through it shows me the correct file size, then when I check back the file size is 0?  Strange.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 07 October 2006 10:21 AM   [ Ignore ]   [ # 16 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  01-05-2006

I’ve updated the extension again to support multiple files.  Enable it in the extension manager by clicking on settings.  If you have multiple files enabled you can use the following template structure:

{multi_[field_name]}
{[field_name]}
{
/multi_[field_name]}

Where [field_name] is the short name of your field.  For example I have a field named article_image so my structure would look like this:

{multi_article_image}
<img src="{multi_article_image}" alt="Article Image" />
{/multi_article_image}

If you don’t have multiple files turned on then you can just use the single variable like so {article_image}.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 14 October 2006 12:04 PM   [ Ignore ]   [ # 17 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  01-05-2006

If you’re using this extension in combination with any of my other extensions it is highly recommended that you update all of them or field data may not enter correctly.  You can find links to the individual posts below:

Checkbox: http://expressionengine.com/forums/viewthread/38843/
Multi Drop-down List: http://expressionengine.com/forums/viewthread/38370/
Multi Text: http://expressionengine.com/forums/viewthread/39153/
File: http://expressionengine.com/forums/viewthread/38997/

Or you can find a list of them on my docs page: http://docs.markhuot.com

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 15 October 2006 01:18 PM   [ Ignore ]   [ # 18 ]  
Research Assistant
RankRankRank
Total Posts:  970
Joined  06-13-2005

There’s a bug. This File ext. doesn’t allow creating new custom fields (I created a new Group).

I get

MySQL ERROR:

Error Number: 1054

Description: Unknown column ‘field_download_directory’ in ‘field list’

Query: INSERT INTO `exp_weblog_fields` (`group_id`, `field_id`, `field_name`, `field_label`, `field_instructions`, `field_type`, `field_pre_populate`, `field_related_to`, `field_maxl`, `field_ta_rows`, `field_list_items`, `field_download_directory`, `field_related_orderby`, `field_related_sort`, `field_related_max`, `field_fmt`, `field_show_fmt`, `field_text_direction`, `field_required`, `field_search`, `field_is_hidden`, `field_order`, `field_related_id`) VALUES (‘5’, ’‘, ‘stbody’, ‘stbody’, ’‘, ‘text’, ‘n’, ‘blog’, ‘128’, ‘6’, ’‘, ’‘, ‘title’, ‘desc’, ‘0’, ‘xhtml’, ‘y’, ‘ltr’, ‘n’, ‘n’, ‘n’, ‘29’, ‘4’)

If I disable the File ext., I can create custom fields.

Thanks!

 Signature 

tulks.com

Profile
 
 
   
1 of 38
1
 
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 10:33 AM
Total Registered Members: 62691 Total Logged-in Users: 24
Total Topics: 77272 Total Anonymous Users: 16
Total Replies: 417101 Total Guests: 183
Total Posts: 494373    
Members ( View Memberlist )