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

File

Development and Programming

Bruce2005's avatar
Bruce2005
536 posts
17 years ago
Bruce2005's avatar Bruce2005

No. do you know of any way to have conditionals. I tried them all, none work. file works multiple works showing file names and urls work using a conditional for a file or image don’t. removing if file_ext don’t help.

       
Ty Martin's avatar
Ty Martin
232 posts
17 years ago
Ty Martin's avatar Ty Martin

Bruce, I found that using any plugins between or around my conditionals broke it. Do you have any plugins or any other code going on? (I feel your frustration!)

       
Bruce2005's avatar
Bruce2005
536 posts
17 years ago
Bruce2005's avatar Bruce2005

wondermonkey

You hit the nail on the head!!! I had a lot of other conditionals going on, removed all other stuff and it works now. Thanks!!!!!

Can now: have 2 separate extension fields on same page. show images or file paths. if images shows them as images if fils shows url to download. if both images and files in same field, shows images as images and files as links. So if it helps anyone: Uploading multiple images or files using the file extension.

{if file_ext}
{file_ext}
{if file_thumb_url} 
<a href="http://{file_url}">{file_thumb_url}</a>
{if:else} 
<a href="http://{file_url}">download {file_name}</a> 

{/if}
{/file_ext} 
{/if}

Thank you very much! 😊

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo

Mark,

As they say in Australia - “Where the bloody hell are ya?”

We want SAEF and adjustable thumbnail sizes!

Seriously, it would be nice to have those features.

       
Jermaine M's avatar
Jermaine M
20 posts
17 years ago
Jermaine M's avatar Jermaine M

SAEF works - at least for posting…have not tried editing yet - i’ll try to post later what I did to get it to work

       
Taiga's avatar
Taiga
7 posts
17 years ago
Taiga's avatar Taiga

I get Notice on the top of Publish and Edit pages after including File custom field. I know that server path to the folder is correct. Using version 311

Notice: Undefined index: server_path in /[my_server_path]/extensions/ext.mh_file_ext.php on line 521

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo
SAEF works - at least for posting…have not tried editing yet - i’ll try to post later what I did to get it to work

Good work, that would be fantastic 😊

       
Jermaine M's avatar
Jermaine M
20 posts
17 years ago
Jermaine M's avatar Jermaine M
We want SAEF and adjustable thumbnail sizes!

The issue I had in getting SAEF to work is that the form generated by EE needs enctype==”multipart/form-data”. I ended up creating an extension based off what Phoebe posted sometime ago. Her code ended up giving me issues and would not enable/disable. I have attached the file I created and the only option you need to change is…

$options['hidden_fields']['URI']=='/post/images/'

Change /post/images to the path of your SAEF - so, if your image upload form is located at http://www.domain.com/myform/ - you would have the following…

$options['hidden_fields']['URI']=='/myform/'

As far as the SAEF, I hardcode my image fields like so…

<input type="hidden" name="field_id_11" value="" />
<input name="field_id_11_img[]" type="file" class="file" />

Note: I only allow 1 image upload per file field. So, if I want the ability to upload 4 files I end up having 4 file fields. If you want multiple image uploads per field I assume you would need to add functions to mod.weblog_standalone.php as Senor Dave posted, although I have not tested that functionality.

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo

I’m implementing this now as we speak. I’ll let you know how I go…

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo

Sorry to sound simple but in this code -

<input type="hidden" name="field_id_11" value="" />
<input name="field_id_11_img[]" type="file" class="file" />

Where does the custom field name go? Is it in the hidden field name or the second input name?

What is the double square bracket for?

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo

Success thank you!

I checked out Senor Dave’s post and it all became clear.

Is this a Wiki Entry yet?

       
Jermaine M's avatar
Jermaine M
20 posts
17 years ago
Jermaine M's avatar Jermaine M
Sorry to sound simple but in this code -
<input type="hidden" name="field_id_11" value="" />
<input name="field_id_11_img[]" type="file" class="file" />
Where does the custom field name go? Is it in the hidden field name or the second input name? What is the double square bracket for?

You do not use the custom field names, you just use the field_id numbers that EE stores for the custom field names. You can find these by going to Admin >> Utilities >> SQL Manager >> Manage Database Tables. Then browse the exp_weblog_fields table. The first column contains the field_id numbers for your custom fields.

The double brackets are because the file extension stores the files in an array being that it allows you to upload multiple files for one field.

       
Jermaine M's avatar
Jermaine M
20 posts
17 years ago
Jermaine M's avatar Jermaine M
Success thank you! I checked out Senor Dave’s post and it all became clear. Is this a Wiki Entry yet?

No problem! Glad I was able to help.

       
stinhambo's avatar
stinhambo
1,268 posts
17 years ago
stinhambo's avatar stinhambo

Now we wait for Mark to incorporate the enctype extension and docs for the hardcoding of the file input!

It’s not like he has a real job or anything… lol

       
elemental's avatar
elemental
77 posts
17 years ago
elemental's avatar elemental

I am using latest EE build but I am getting error in the CP when I want to add new file upload destination or even edit and old one. This happens when I push the Update button.

ExpressionEngine 1.6.2 Build: 20080225 File (extension), by Mark Huot (v.3.1.1)

When Mark’s File extension is disabled all is OK, less the cool functionality :(

MySQL ERROR:

Error Number: 1064

Description: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON DUPLICATE KEY UPDATE id=values(id), `key`=values(`key`), val

Query: INSERT INTO exp_mh_file VALUES('', 2, 'allow_multiple', 'no') ON DUPLICATE KEY UPDATE id=values(id), `key`=values(`key`), value=values(value)

Any advice appreciated Stan

       
First 28 29 30 31 32 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.