This extension is great. Just what I have been looking for! I’ve got a question though. How do you dynamically access a thumbnail of an uploaded image? As it is right now it just sticks in a URL to the original image, but I see no way to get it to output the URL to the thumb?This is my quick/dirty approach for a single upload:<?php $cust = '{article_image}'; // Name of custom field. # pathinfo might work better if using PHP 5.2.0 # http://www.php.net/manual/en/function.pathinfo.php //$file_name = pathinfo($cust); echo $file_name['filename']; $path_to_files = dirname($cust); // Path to file. $parts = explode('.', basename($cust)); # $parts[0]; // file_name # $parts[1]; // .ext echo $path_to_files.'/'.$parts[0].'_t.'.$parts[1]; # Output: # <img src="http://www.site.com/images/articles/red-lilly_1_t.jpg" alt="" /> ?>
I was looking for how to do this too.
It seems that this works:
{[custom_field_short_name]_thumb}
(Just add ‘_thumb’)
A hcrap, I’m getting an error when uploading on a local server (wasn’t a problem with 1.5.2 on the same server). The error I am getting is - Warning: move_uploaded_file(C:/dev/manag/admin/C:/dev/manag/images/uploads/hambo.jpg) [function.move-uploaded-file]: failed to open stream: Invalid argument in C:\dev\manag\admin\extensions\ext.file.php on line 552 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move ‘C:\Program Files\xampp\tmp\php26C.tmp’ to ‘C:/dev/manag/admin/C:/dev/manag/images/uploads/hambo.jpg’ in C:\dev\manag\admin\extensions\ext.file.php on line 552
Same here.
I’m using the option “Allow Multiple Files” with the file extension. So I don’t know how much files the client will add. If there is a way to create 2 textfields for every file field that would be great but I believe that’s not possible, or am I wrong?
Write know I have 2 extra fields where I store the file title and file description for each file separated by a line break. For adding files this is not a problem, I just add a string at the end of each field but removing a file is not that easy.
Hello,
I have just recently installed this extension and come across an oddity, not sure if this is a bug or if it’s something with my install.
After initially installing I went into my custom weblog fields to update in order to test. All went as one would expect - everything worked perfectly.
Today, I began editing the balance of the custom fields I needed to update to take advantage of this extension. I opened up one of my custom filed groups and selected the first custom field in that group which I’m associating with an image upload. I began editing the necessary items (field type / upload location) and then updated the field.
I received the following error:
“Notice: Undefined variable: field_type in …edited…/public_html/system/cp/cp.publish_ad.php on line 7214”.
So, I thought maybe I just missed something…I re-edited and got the same error message. Then, I deleted the field and created a new field to see if this had any effect. No.
I then un-installed the extension and re-installed. I still received this error message, but, to note, the changes I made the prior day were functioning properly.
After looking closely at the field that was taking the “file” filed type, the only difference was it’s order - it was not defined as the first field in the field group order.
I then went back to the custom field in question and re-ordered it in it group to anything other then the first field and…vwa la…it functions just fine.
It seems when I try to define the field type to “file” in the first custom field of a custom field group I get this error; if the field is not the first in the field group, the extension works properly.
Any ideas why this is occuring?
This is actually documented somewhere here on the forums - so it has happened to others. I wish I could point you to the right spot. I think the reason this happens is because EE doesn’t have this default file type listed in the core file, so it comes up as undefined.
Hello, how are you?
Yeah, I looked thru this thread to see if I could spot a reference to this but didn’t see anything. In all honesty thought this was not an exhaustive search (only about the last 5/6 pages of this thread).
Thanks for the info. At least I now know this isn’t my install.
Regards!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.