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

Jamie Rumbelow's avatar
Jamie Rumbelow
546 posts
17 years ago
Jamie Rumbelow's avatar Jamie Rumbelow

Hey Mark,

Great extension, but I am having some troubles with it. For some reason, I get a Unknown Error every time I try to upload a file. My folders are set to 777, my PHP build supports file streams, so I don’t know what’s up.

Could you help?

Regards,

Jamie

       
Steven SE's avatar
Steven SE
8 posts
17 years ago
Steven SE's avatar Steven SE

Anyone know how to get the extension of a file?

EDIT: nevermind, allready got it!

       
ztaylor's avatar
ztaylor
1 posts
17 years ago
ztaylor's avatar ztaylor

When attempting to upload files (v3.1.1), I encountered the error message: “There was a problem uploading file.ext.” Error reporting showed that the issue was that the absolute file path was concatenated onto itself, resulting in a nonsensical path consisting of two absolute paths stuck end to end. I fixed it by changing lines 699 and 700 to:

$server_path = preg_match("/^\//", $server_path)==0?$server_path:$server_path;
$server_path = preg_replace("/^\/|\/$/", '', $server_path).'/';

This has had the side effect of causing the save to crash to a blank page, which seems to be caused by the resize function. I tried disabling the image resizing in the “File Upload Preferences” area with no luck, but commenting out the contents of the resize function made things error and crash free.

Ideally, I’d like to have the option to use the resizing capability, so if anyone has any suggestions, I’d appreciate it.

Also, I’m having trouble with MySQL error 1062 when attempting to update the “File Upload Preferences.” Disabling the File extension fixes this, but that’s no good if I need to change the extension-specific preferences. So far, I’ve been having to edit the “ext_mh_file” table by hand. This problem has been mentioned here before, but no solution has come up.

       
purefusion's avatar
purefusion
29 posts
17 years ago
purefusion's avatar purefusion

What would it take to get this extension to support sorting?

I want to do three things when using variable pairs: • Sort by random order • Sort by order specified in entry* • Specify a limit for files/images displayed

  • I also want to be able to specify order of files within the entry. Drag and drop would be awesome, but a simple numbering system would be nice too.

I dug around the bowels of the extension, but I don’t know if I should start poking around without knowing exactly what I’m doing. 😊

So what are my options here?

       
Meirion's avatar
Meirion
127 posts
17 years ago
Meirion's avatar Meirion

I’m using Mark’s File Extension in conjunction with the imgsizer plugin for uploading hi-res photos and being able to use the at any size, eg for thumbnails, and it’s working very well.

My only annoyance is that if the File Extension is set to display thumbnails, when you upload a large file it displays that file in the img tag, rather than a shrunk down thumb version. So if you upload a large photo, it is then immediately downloaded in full as the CP page refreshes. It is resized purely by the height=”” and width=”” attributes on the img tag - quite clunky!

Any way of fixing this?

       
davenport's avatar
davenport
67 posts
17 years ago
davenport's avatar davenport

http://www.davenportdesign.net/fm/

Code:

{photo_upload}<a href="http://{file_path}">{file_thumb_path}</a>{/photo_upload}

Output:

<a href="http://{file_path}">{file_thumb_path}</a>

The tags inside my file custom field are not being parsed. Any ideas? I’ve used this extension before with much success, but it doens’t seem to work now. (The only thing different, perhaps, is that I have not installed EE in the root directory? … it’s in /fm/)

On another note, obviously this extension is very useful, and is helping us create websites much more intuitive and feature rich for our clients – yet Mark Huot has received no monetary compensation. I would gladly contribute to Mark if he would continue development of this extension…

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
17 years ago
Matt Weinberg's avatar Matt Weinberg
The tags inside my file custom field are not being parsed. Any ideas? I’ve used this extension before with much success, but it doens’t seem to work now. (The only thing different, perhaps, is that I have not installed EE in the root directory? … it’s in /fm/)

Try {file_url} and {file_thumb_url} instead of “path”.

       
davenport's avatar
davenport
67 posts
17 years ago
davenport's avatar davenport

Ahhhh problem solved… path/url - things like that drive me up the wall! 😊 Thank you very much.

       
nomolos's avatar
nomolos
24 posts
17 years ago
nomolos's avatar nomolos

Is anyone able to confirm whether or not this extension works with the MSM? Thanks 😊 [Yes, I’ve searched the thread and wasn’t able to find a post talking about the MSM]

       
Phil J Leitch's avatar
Phil J Leitch
85 posts
17 years ago
Phil J Leitch's avatar Phil J Leitch

Is there a way to grab the height and width of the image?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Hi Phil,

Not sure if there are any built in methods or variables to do that in the module, others may know different on that though but I use this piece of PHP to find mine at the moment.

<?php
$imageurl ="http://www.avshutter.com/images/photos/image-detail/{photos-download-url}";
list($width, $height, $type, $attr) = getimagesize("$imageurl");
?>

You can then use one of :

<?php echo $height?>
<?php echo $width?>

to get what you need.

Unfortunately this does mean that you need to have PHP turned on in your template.

On another note does anyone know how to just get hold of the file_name or file_url when just using a single file upload. When you use multiple uploads then you can use those variables from within a variable pair but when you use single file upload mode then you can only get at the full URL to the file. I know that I can use the Extract URL Plus plugin to get at this but in a certain case this is not possible with what I am doing or more truthfully really gets quite messy with the template code so was just wondering if there is any variable hiding in there for getting the file_url when in single file upload mode?

Best wishes,

Mark

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
17 years ago
Matt Weinberg's avatar Matt Weinberg
but when you use single file upload mode then you can only get at the full URL to the file.

That’s not my experience. You can use the single variable or variable pair no matter if you’ve enabled single or multiple uploads. Just use the pair, put in those variables, and it’ll loop once.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Well now that’s just plain weird!! Just tried this again (I absolutely promise I did try that before) and now it is working!!

I must have had something else weird going on in the template as I tried that first but it just kept on bringing back the full URL to the file for me.

All very weird. Thanks for letting me know that it works for you as it made me try it out again!!! 😉

Best wishes,

Mark

       
Herudea's avatar
Herudea
9 posts
17 years ago
Herudea's avatar Herudea

Hey guys,

So I’m a n00b strait up - so I really appreciate any help here.

I have the extension installed fine, but I guess I don’t really know how to implement it inside a template. So a basic example would be awesome. I have dug through the majority of the posts here, but everything I have tried renders nothing on the page.

I also tried using the EE entriestag to pull in specific entries from a dedicated weblog(so the users can just change the image in the weblog… but that didn’t work either (I have successfully brought content in from a weblog…) but I must be doing something wrong!

the weblog code looks like this -

{exp:weblog:entries weblog="front_images" disable="catgories|member_data|pagination|trackbacks" entry_id="8" }
   {page_body}
{/exp:weblog:entries}

also, if there is a better way to allow a user to just change out an image that is going to stay in the same spot, let me know. Basically i just don’t know much about EE yet, and any help would be wonderful. Thanks so much!

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
17 years ago
Matt Weinberg's avatar Matt Weinberg

Herudea,

Is {page_body} the name of the custom field that has the “File” type? When it renders, what does the HTML end up looking like?

-Matt

       
First 33 34 35 36 37 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.