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! 😊
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.
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?
Sorry to sound simple but in this code -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?<input type="hidden" name="field_id_11" value="" /> <input name="field_id_11_img[]" type="file" class="file" />
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.
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
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.