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

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

I had huge problems with the count parameter in this extension, especially if you’ve deleted and reuploaded images on an entry. I ended up doing the count as php, because the total_results was usually correct.

       
ejectmedia's avatar
ejectmedia
12 posts
17 years ago
ejectmedia's avatar ejectmedia

I have deleted and re-uploaded for some of these, but not all.

I finally decided to make the best of what I’ve got and work with this. I want 4 images, so I’ll just limit it to three, and then it randomly displays the last image, so that acts as my 4th! I know it’s stupid, but it works. It would be better if I could actually display the 4th image, but whatever.

       
the wire's avatar
the wire
31 posts
17 years ago
the wire's avatar the wire

Please, can someone help with the following issue:

It doesn’t restrict the file type and file size even though the upload directory is correctly setup to accept only images and restrict file size. I checked the default EE file upload and the restrictions work fine.

This extension would be great if I can solve this problem.

Thanks

       
Dane Thomas's avatar
Dane Thomas
139 posts
17 years ago
Dane Thomas's avatar Dane Thomas

Has anyone ever had the upload loading bar displayed on this extension? It was meant to be added some time ago but I’ve never seen the loading bar when I upload a large file.

       
Eastwood Design's avatar
Eastwood Design
605 posts
17 years ago
Eastwood Design's avatar Eastwood Design

not sure what I am missing.

I am using 1.6.3 and trying to use multi file displaying the thumbnail linking to the full size image using lightbox

sitesights_image is the custom field name

{if sitesights_image != ""} {/if} 
        {if sitesights_image} 
{sitesights_image} <div class="thumb"><a href="http://{file_url}">" title="{title} - Click n to continue"]{file_thumb_url}</a></div>{/sitesights_image} 
        
{/if}
       
Dane Thomas's avatar
Dane Thomas
139 posts
17 years ago
Dane Thomas's avatar Dane Thomas

Try {sitesights_image_thumb} for the thumb image.

       
Adam George's avatar
Adam George
283 posts
17 years ago
Adam George's avatar Adam George

This is a great extension, however, when I use the version 3.1.1 of this extension, it creates a thumbnail that is the same size as the original, even though I have specified a max width, set it to resize images, and set Anchor_width to yes.

I’m using EE 1.6.3 - any ideas why this is happening?

       
Kerim Satirli's avatar
Kerim Satirli
52 posts
17 years ago
Kerim Satirli's avatar Kerim Satirli

I can confirm the problem Adam George is having, both for 1.6.2 and 1.6.3

       
idawgik's avatar
idawgik
38 posts
17 years ago
idawgik's avatar idawgik

I’m having issues getting this extension working on a site I’m developing. It’s so far a pretty vanilla EE install on a Windows Server 2003 / IIS6 server.

As far as I can tell, I’ve got everything configured correctly, but whenever I try and upload a file, I get the following error:

File Attachment – There was a problem uploading ‘denver3.jpg’.

This happens with any file I try, images, pdfs, etc. I have verified write permissions for the upload directory, and the built-in uploader works fine. I would like to get this working as I find the built in uploading to be too confusing for my clients.

Any suggestions? I have tried disabling the extension, creating a new upload directory, and then re-enabling it and re-configuring. Still no go.

Any help is appreciated.

Thanks

       
tonic2's avatar
tonic2
18 posts
17 years ago
tonic2's avatar tonic2

Hi,

I’m having the same problem developing a site on a Windows XP box running Apache. It’s a fairly fresh install running EE 1.6.3. The standard EE file upload method works fine.

If I remove the @ (which suppresses error messages) on line 869 of ext.mh_file_ext.php and try uploading a file again, I get the following error message:

Warning: move_uploaded_file(/D:/www/website/cms//D:/www/website/ee/images//uploads/01.jpg) [function.move-uploaded-file]: failed to open stream: Invalid argument in D:\www\website\cms\extensions\ext.mh_file_ext.php on line 869

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move ‘D:\wamp\tmp\phpFF.tmp’ to ‘/D:/www/website/cms//D:/www/website/ee/images//uploads/01.jpg’ in D:\www\website\cms\extensions\ext.mh_file_ext.php on line 869

I’ve trawled through this thread and found a few posts with people getting the same error, but I couldn’t see any solutions… It looks like it’s trying to treat the file paths as Unix paths rather than Windows paths. Other people seem to have it working on Windows though. Is it likely to be a config setting I need to change?

       
tonic2's avatar
tonic2
18 posts
17 years ago
tonic2's avatar tonic2

So I’ve had another look at this, I found that I had some of my upload paths set wrong in:

CP Home › Admin › Weblog Administration › File Upload Preferences › Edit File Upload Preferences

I fixed them up but was still getting an issue. 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!

       
adam11238's avatar
adam11238
34 posts
17 years ago
adam11238's avatar adam11238

I’m running into a couple quirks that I’m hoping someone else has seen: 1. I’ve set a max width and max height in the file upload preferences, and it resizes images smaller than that up to the max dimensions. Shouldn’t it just leave them alone? 2. If I delete the entry that the image/file is associated with, is there any way to also delete the image/file from the server.

Many thanks for any help.

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

Those are two options you need to look for. Check out the documentation here:

http://docs.markhuot.com/ee/extensions/file

The first question requires you to change the “Resize Images” setting–you probably want to use “Auto.”

The second question is to set “delete from server” to “yes.”

Some people aren’t seeing those options on their EE installs in the file upload preferences after installing the extension. Are you included in that?

       
gridonic's avatar
gridonic
231 posts
17 years ago
gridonic's avatar gridonic

Hi

I’m getting a 403 Forbidden error when uploading files using the latest version of this extension. Files seem to get 600 permissions instead of 644. Any ideas?

Problem was already describer here: http://ellislab.com/forums/viewthread/74710/#381556

I’d really love to use this extension as it offers a greater flexibility for multiple image upload than defining several, numbered custom fields for each image.

EDIT:

Hi, i was able to solve it! It seems that the problem (at least on my webhost, because our webhost is a security freak…) was caused by the move_uploaded_file function. By default, or at least on most webservers, files uploaded get the usual permissions set which in most cases is “0644”.

In my case, the uploaded files moved with this function seem to get “0600”. The fix is simple and seems to work perfectly here, others with the same problem will just have to fix it and maybe marc can incorporate this fix in the next release.

I had to change the “ext.mh_file_exp.php” extension file starting at line 880 from:

//  =============================================
//  Do the Upload
//  =============================================
foreach($file_tmp_names as $file_key=>$file_tmp_name)
{
    if(@move_uploaded_file($file_tmp_name, $server_path.$file_names[$file_key]) === FALSE)
    {
        $errors[] = str_replace(array('%{field}', '%{file}'), array($file_field['field_label'], $file_names[$file_key]), $LANG->line('error_transfer'));
    }
}

to

//  =============================================
//  Do the Upload
//  =============================================
foreach($file_tmp_names as $file_key=>$file_tmp_name)
{
    if(@move_uploaded_file($file_tmp_name, $server_path.$file_names[$file_key]) === FALSE)
    {
        $errors[] = str_replace(array('%{field}', '%{file}'), array($file_field['field_label'], $file_names[$file_key]), $LANG->line('error_transfer'));
    }
    //if all went well, set the permissions on the uploaded + moved file
  else
  {
    chmod($server_path.$file_names[$file_key], 0644);
  }
}

You might also add some error messages by checking the return value of the chmod function and also add surpress warning by superceeding it with a @, but in my case that was not neccessary.

       
gridonic's avatar
gridonic
231 posts
17 years ago
gridonic's avatar gridonic

Another strange bug i encountered when setting this all up it the usage of {count}. Using the default, latest version of the plugin always returned “1” as the count value. I dug up the code and tried to fix this in various ways. The {count} variable is assigned here, starting at line 1214:

foreach($files as $count=>$file)
{

    $thumb = $this->_add_suffix($file, $this->thumb_suffix);
    if(in_array($thumb, $thumbs) !== FALSE)
    {
        $thumb_path = $file_field['server_path'].'/'.$thumb;
        $thumb_url = is_file($thumb_path)?$FNS->remove_double_slashes($file_field['url'].'/'.$thumb):'';
    }
    else
    {
        $thumb_path = '';
        $thumb_url = '';
    }

    $var = array(
      'count' => $count+1,
        'total_results' => $total_results,
        'file_name' => $file,
        'file_url' => $FNS->remove_double_slashes($file_field['url'].'/'.$file),
        'file'.$this->thumb_suffix.'_name' => $thumb,
        'file'.$this->thumb_suffix.'_url' => $thumb_url
    );

It seems that when using $count+1, it does not work. I wasn’t able to figure out why but my guess is it will have something to do with the array flipping and keys assigment a couple of lines later.

I also tried setting up an external $count variable of my own instead of using the array key+1, incrementing it in the for loop - also strange results. I was however able to come up with a pretty simple solution with only one drawback: the count variable now starts at “0” instead of “1”, but for a computer science student, that’s even more normal, everything starts with 0 in our world (and ends with 1?) 😊

And here’s the fix:

$var = array(
  'count' => $count,
    'total_results' => $total_results,
    'file_name' => $file,
    'file_url' => $FNS->remove_double_slashes($file_field['url'].'/'.$file),
    'file'.$this->thumb_suffix.'_name' => $thumb,
    'file'.$this->thumb_suffix.'_url' => $thumb_url
);

Just replace “$count+1” with “$count” in the $var array assignment, works for me perfectly so far.

Regards, Peter.

       
First 31 32 33 34 35 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.