37 of 39
37
File
Posted: 24 August 2008 10:33 PM   [ Ignore ]   [ # 649 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007

What happens if you don’t do that, but make sure to use uniquely named files?

By the way, if you don’t have rewrite turned on, but upload a duplicate, it’ll ask you if it should just rename it for you next time.

Profile
 
 
Posted: 25 August 2008 06:51 AM   [ Ignore ]   [ # 650 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1055
Joined  06-05-2007

Not sure, I’ll let you know.  Sure, I do have uniquely named files.

Nope.  Haven’t uploaded any duplicates.

 Signature 

grantmx | designs - design | development | photography | consulting | ee pro profile

Profile
 
 
Posted: 25 August 2008 05:29 PM   [ Ignore ]   [ # 651 ]  
Lab Assistant
RankRank
Total Posts:  177
Joined  07-30-2008

I love the File extension!

But am seeing a strange problem—three forward slashes after my domain name?

An example URL returned (as {jpg_file} or {file_url}) by File when my template is parsed:

http:///www.mydomain,com/images/file.jpg

Note the three slashes at the beginning.

Only seems to happen when I allow multiple file upload.

Any clue?

Profile
 
 
Posted: 25 August 2008 05:48 PM   [ Ignore ]   [ # 652 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007

Have you checked the path in the file upload settings?

Profile
 
 
Posted: 26 August 2008 02:47 AM   [ Ignore ]   [ # 653 ]  
Grad Student
Avatar
Rank
Total Posts:  42
Joined  09-09-2007
Diangy Systems - 20 August 2008 08:46 AM

I am having a problem with using the File Extension on Windows Server 2003. I’ve used the default Upload File function provided by Expression Engine and that works.

However any time I use the File Extension’s File field, I get an error:

Image – There was a problem uploading <name of file>
...
Any suggestions from anyone who has got this working on Windows Server 2003?

I’m having the same problem, is there any fix for this? I saw a post earlier in the thread that said something about a fix in the next release for something to do with IIS servers…

Edit: after more digging through this epic thread, i found this...

tonic2 - 24 April 2008 11:24 AM

It seems that somewhere things were getting confused with the path to save the files to - it was giving a Unix style path with forward slashes in it.  I have temporarily solved the problem by commenting lines 699 and 700 of ext.mh_file_ext.php so they look like this:

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

As I said, this solved the problem for me but it’s probably not the best fix - your mileage may vary!

as he says, YMMV, but it worked for me!

 Signature 

• Web Design & Development • Perth, Western Australia •
@michaelropernotmuch.tumblr.com

Profile
 
 
Posted: 28 August 2008 06:10 AM   [ Ignore ]   [ # 654 ]  
Summer Student
Total Posts:  30
Joined  05-12-2008
Ryan J. Bonnell - 23 May 2008 12:25 PM

I’m having an issue with File 3.1.1 and ExpressionEngine 1.6.3 where the “Resize Images” setting isn’t honored and resets itself to “Auto” every time I update/save the preferences at “CP Home > Admin > Section Administration > File Upload Preferences”.

When this happens, the File extension generates a resized thumbnail for every image uploaded (due to the Auto resizing selected).

I’d like to have the File extension honor my “Resize Images” setting of “None” so that I don’t needlessly have thumbnails generated (since I don’t need them for my specific application).

The server is a RHEL 4 machine with Apache 2.0.52 and PHP Version 4.3.9. I’ve confirmed this behavior on two different installations of ExpressionEngine (on two separate servers).

Is anyone else having the same problem or know of a resolution and/or work-a-round?


I just has this exact problem in File v3.1.1 too.
After looking through the code I found two issues in ext.mh_file_ext.php:

1. At line 403 of ext.mh_file_ext.php the code is:

$r.= '<option'.(($this->resize_images=='no')?' selected="selected"':'').' value="no">Do not resize</option>';

this should be changed to:

$r.= '<option'.(($this->resize_images===FALSE)?' selected="selected"':'').' value="no">Do not resize</option>';

The reason for this is that the _set_prefs() function resets any string parameters of ‘yes’/‘no’ to TRUE/FALSE
This happens on line 458-459.

$value = ($value === 'yes')?TRUE:$value;
$value = ($value === 'no')?FALSE:$value;

This fixes the problem of the file upload preferences page not displaying the correct value for the “Resize Images” field when it has previously been set to “Do not resize”


2. At line 896 of ext.mh_file_ext.php (the “Resize Images” section) the code is:

if($this->resize_images !== FALSE && $file_field['max_width'] != '' || $file_field['max_height'] != '')

this should be changed to:

if($this->resize_images !== FALSE && ($file_field['max_width'] != '' || $file_field['max_height'] != ''))

Brackets must enclose the or ( || ) section of this if statement, otherwise it will pass even when resize_images is set to FALSE.

Profile
 
 
Posted: 28 August 2008 10:08 AM   [ Ignore ]   [ # 655 ]  
Grad Student
Avatar
Rank
Total Posts:  51
Joined  10-25-2006

Mark,

Though you have likely heard it a million times, this a great extension and I appreciate your efforts. 

I am wondering if you have fielded the following request and/or I would be interested to know if there is a solution for or what would be involved with developing the following.

Would love capability to be able to add a Name/label to the file being uploaded and to be able to add that name to a template.  The idea is I am associating a file or multiple files with an entry and would like to display them in a link with a more human and useful name rather than the fine name.  For example to do:

<a href="{custom_field}">{name for file entered upon upload}</a>

 Signature 

Minds On Design Lab
http://www.mod-lab.com

Profile
 
 
Posted: 28 August 2008 10:14 AM   [ Ignore ]   [ # 656 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007

Mark hasn’t participated in the thread in quite a while. I posted a slightly annoying work-around to this problem here: http://expressionengine.com/forums/viewthread/38997/P342/#335189 (and notice Ryan’s suggestion 2 posts below it).

I’ve always thought it would be a great addition to the plugin, though.

Profile
 
 
Posted: 28 August 2008 10:24 AM   [ Ignore ]   [ # 657 ]  
Grad Student
Avatar
Rank
Total Posts:  51
Joined  10-25-2006
slapshotw - 28 August 2008 10:14 AM

Mark hasn’t participated in the thread in quite a while. I posted a slightly annoying work-around to this problem here: http://expressionengine.com/forums/viewthread/38997/P342/#335189 (and notice Ryan’s suggestion 2 posts below it).

I’ve always thought it would be a great addition to the plugin, though.

Thanks slapshotw, will check this out.

 Signature 

Minds On Design Lab
http://www.mod-lab.com

Profile
 
 
Posted: 28 August 2008 11:06 AM   [ Ignore ]   [ # 658 ]  
Grad Student
Rank
Total Posts:  80
Joined  11-12-2007

I need help with the tags.  This is what I put:

{exp:weblog:entries weblog="photo_gallery"}
{images}
{upload_picture}
<br />    <----------file field
{picture_caption}
{
/images}
{
/exp:weblog:entries}

When I publish the page and view it I get this:

{images} http://www.site.org/uploads/dayton_gallery/landscape.jpg
District Conference pictures {/images}

I don’t see the picture!

Profile
 
 
Posted: 28 August 2008 01:22 PM   [ Ignore ]   [ # 659 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007

What are the images, upload_picture, and picture_caption fields? From that output it doesn’t seem like {images} is the name of a custom field.

Profile
 
 
Posted: 28 August 2008 03:54 PM   [ Ignore ]   [ # 660 ]  
Lab Assistant
RankRank
Total Posts:  177
Joined  07-30-2008

has anyone attempted to mod the File extension to allow multiple files to be selected from the pop-up dialog?

right now, when i want to upload multiple files to one blog entry, i need to click File… button, open a new dialog, click the file, click OK, then repeat for each file.

would be easier on the client if they could just open one file dialog and choose multiple files…

Profile
 
 
Posted: 29 August 2008 05:49 AM   [ Ignore ]   [ # 661 ]  
Grad Student
Rank
Total Posts:  80
Joined  11-12-2007

{images}{/images} I got from the Mark Huot instructions on his website.  I admit they were a little confusing:

Template Tags
{images backspace
="6"}

{if file_path}{file_path}
<br />{/if}
{if file_thumb_path}{file_thumb_path}
<br />{/if}

{
/images}

{upload_picture} is the actual FILE field, and {picture_caption} is just a custom field that will hold text.  So what I am getting when I view the published page is that it displays the string of the image instead of the image itself.

Profile
 
 
Posted: 29 August 2008 08:17 AM   [ Ignore ]   [ # 662 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007

You need to use the name of your custom field, not “images.” Mark was just using that as an example.

{upload_picture backspace="6"}

{if file_path}{file_path}
<br />{/if}
{if file_thumb_path}{file_thumb_path}
<br />{/if}

{
/upload_picture}

Profile
 
 
Posted: 29 August 2008 08:36 AM   [ Ignore ]   [ # 663 ]  
Grad Student
Rank
Total Posts:  80
Joined  11-12-2007

I have tried doing what you have said:

{exp:weblog:entries weblog="photo_gallery"}
{upload_picture backspace
="6"}

{if file_path}{file_path}
<br />{/if}
{if file_thumb_path}{file_thumb_path}
<br />{/if}

{
/upload_picture}
{picture_caption}
{
/exp:weblog:entries}

When I publish the page I get nothing

Profile
 
 
Posted: 29 August 2008 08:46 AM   [ Ignore ]   [ # 664 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007

Let’s take it off this thread. PM me.

Profile
 
 
Posted: 11 September 2008 01:43 PM   [ Ignore ]   [ # 665 ]  
Summer Student
Total Posts:  4
Joined  08-19-2008
George Ornbo - 28 July 2008 04:38 AM

Using the file extension I am coming across an issue where the resized file is resizing ok but taking the incorrect MIME type. So I’ve got a .jpg file with a MIME type of GIF. I’ve run a few tests and any image file uploaded gets the MIME type of GIF.

Just came across your post after running into the same problem. I mostly upload jpegs and I found that popping the jpeg if() clause to the top of the chain fixed this problem.

on line 915:

if(($src_img = @imagecreatefromjpeg($server_path.$file_name)) !== FALSE) {}
else if(($src_img = @imagecreatefromgif($server_path.$file_name)) !== FALSE) {}
else if(($src_img = @imagecreatefrompng($server_path.$file_name)) !== FALSE) {}

and on line 1030 (I think this is the culprit):

if(@imagejpeg($dst_img, $dst) !== false) {}
else if(@imagegif($dst_img, $dst) !== false) {}
else if(@imagepng($dst_img, $dst) !== false) {}

I’ve not tested this with other filetypes, so you might end up uploading GIFs/PNGs that end up with jpeg MIMES, but at least it’s a start!

Also, I found that the jpeg resizing was reducing the quality of the image too much as the default is 75%. The imagejpeg function has an optional quality setting for jpegs, so I added this to line 1029:

if(@imagejpeg($dst_img, $dst, 100) !== false) {};

Profile
 
 
Posted: 11 September 2008 01:53 PM   [ Ignore ]   [ # 666 ]  
Summer Student
Total Posts:  4
Joined  08-19-2008

...and now a question, rather than an answer! I’ve not seen a response to this in the forums, but apologies if I’ve missed something.

If I try to add a large image (over 3mb), the memory times out and I get the ‘white screen of death’ (which someone so aptly described somewhere else).

I’ve got the maximum file size set to 2097152 bytes (2mb) in the file upload settings, but the file size doesn’t seem to be getting caught early enough in the proceedings? Any suggestions of getting an error message to show up rather than the system freezing? I tried uploading the file using the first party upload button, and this catches the problem in time.

Any help much appreciated!

Profile
 
 
   
37 of 39
37
 
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 09:33 AM
Total Registered Members: 64878 Total Logged-in Users: 63
Total Topics: 81805 Total Anonymous Users: 38
Total Replies: 439760 Total Guests: 300
Total Posts: 521565    
Members ( View Memberlist )
Newest Members:  pticketdxrsmdanbilly8hrkiliwysso50kexpressoKlaasdarrenstylestravelerjcaton