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

mhulse's avatar
mhulse
329 posts
15 years ago
mhulse's avatar mhulse

Eric,

I should mention… Personally, I have never used the MH File for more than one upload at a time, so I have not noticed the problem(s) that you are experiencing.

As an alternative solution, you might try this file upload extension:

nGen File Field for ExpressionEngine

Requires PHP 5 to run (FieldFrame 1.3.4 needs PHP 5+), but it looks like a decent extension.

       
Eric Snyder's avatar
Eric Snyder
202 posts
15 years ago
Eric Snyder's avatar Eric Snyder

Well…very interesting. I changed error reporting and no errors…????????? So I turned on display queries and the only query that is there is inserting the upper area preferences. There is no query for the multiple file uploads.

       
narendra's avatar
narendra
44 posts
15 years ago
narendra's avatar narendra

Hello,

I am getting below error.

Notice: Undefined index: key in C:\inetpub\wwwroot\LocalUser\massatucson.org\httpdocs\newsite\system\extensions\ext.mh_file_ext.php on line 452

In linux server it works fine but in WindowsNT it’s giving above error.

       
mhulse's avatar
mhulse
329 posts
15 years ago
mhulse's avatar mhulse

Hi Narendra,

Are you using the latest version of the extension?

What version of EE are you on?

If you ignore the notice message, does the extension still function?

A php notice is not a show stopper… If you log out, I am guessing you do not see the notice?

Can you post your template code.

As a quick and dirty fix, you could crack open the file extension and change 452 to this:

$key = @$pref['key'];

I would like to see your template code though…

Good luck!

Cheers, Micky

       
Joel Bradbury's avatar
Joel Bradbury
18 posts
15 years ago
Joel Bradbury's avatar Joel Bradbury

Hey Mark,

Just a quick note that the documentation is slightly off. In the code example you’ve got

{images backspace="6"}

{if file_path}{file_path}
{/if}
{if file_thumb_path}{file_thumb_path}
{/if}

{/images}

But the variables file_path and and file_thumb_path appear to be wrong. Shouldn’t that be file_url and file_thumb_url?

Cheers

       
Eric Snyder's avatar
Eric Snyder
202 posts
15 years ago
Eric Snyder's avatar Eric Snyder

This is in reference to mhulse’s most excellent help at this post.

Sorry. It took quite some time (as I thought it would) to get access to the backend at GoD***y (looks like I am cussing doesn’t it?) to look at the database. The additional preferences for this extension is kept in the table exp_mh_file. Each preference is stored individually with a loop here in the file ext.mh_file_ext.php. On line 492 there is a bug:

$pref_results = $DB->query("SELECT * FROM exp_mh_file WHERE exp_mh_file.upload_id='{$id}' AND exp_mh_file.key='{$key}'");

if (!$pref_results) {
$DB->query("INSERT INTO exp_mh_file VALUES('', {$id}, '{$key}', '{$value}')");
}else{
$DB->query("UPDATE exp_mh_file SET exp_mh_file.value='{$value}' WHERE exp_mh_file.upload_id='{$id}' AND exp_mh_file.key='{$key}'");
}

The if clause looks like the culprit. It needs to be:

if ($pref_results->num_rows == 0)

Even if the query is empty, the object that the query is assigned to is not. The variable $pref_results will test non empty if the query returns no results. See the docs here for testing for a null query result.

Change the code and it stores the prefs just fine.

       
Frank Harrison's avatar
Frank Harrison
154 posts
15 years ago
Frank Harrison's avatar Frank Harrison

I can’t seem to get this working properly: I’m using this extension multiple times on a page, some single images, some single files and some groups of images. Among other things, I’ve got a couple in a list:

{programme-music-cue-sheet}<li><a href="http://{file_url}">Download music cue sheet (pdf)</a></li>{/programme-music-cue-sheet}
{programme-script}<li><a href="http://{file_url}">Download script (pdf)</a></li>{/programme-script}

Weirdly, if I delete one (either one) it works. But having both of these in causes the template to crash (everything is displayed except for the weblog:entries tag that contains all the File tags.

I saw someone recommend not mixing single with paired tags - have changed them all to pairs but still not working… I’ve also checked that I’m using the right names of all custom fields. I’m using the latest version of the extension and EE 1.6.8.

Any ideas?

EDIT: I just found that it was related to some File tags further down the page. I’m building an image gallery like so:

{programme-gallery-images}
    <li{if count=="3"||count=="6"||count=="9"||count=="12"} class="last-in-row"{/if}>/scripts/phpthumb/phpThumb.php?src={file_url}&w=220&h=126&zc=1&q=80&fltr;[]=usm|60|0.5|3</li>
{/programme-gallery-images}

For some reason, when I had more than 4 images in this gallery, it was crashing the page (this only happened when I also had all the other File tags on the page. I tried removing the if count==”3”… part and that seems to have fixed it. Not sure why…

       
Frank Harrison's avatar
Frank Harrison
154 posts
15 years ago
Frank Harrison's avatar Frank Harrison

Apologies for two posts in a row, but stuck on something new now:

Is there a way to provide alternative content when your File field is empty? I’ve tried

{image}{if file_url}{file_url}{/if}{if:else}/images/my-backup-image.gif{/if}{/image}

… and …

{image}{file_url}{if no_results}/images/my-backup-image.gif{/if}{/image}

But neither of those seem to do it… Am I missing something obvious?

       
Peter Lewis's avatar
Peter Lewis
280 posts
15 years ago
Peter Lewis's avatar Peter Lewis
{/if}{if:else}

would be incorrect (don’t need the {/if} before the else). Try

{image}{if "{file_url}" != ""}{file_url}{if:else}/images/my-backup-image.gif{/if}{/image}
  • should work.
       
Frank Harrison's avatar
Frank Harrison
154 posts
15 years ago
Frank Harrison's avatar Frank Harrison

Ah, sorry! that was a typo when I copied it over - should have spotted that! I did correct that and also tried your way but still no joy. I’ve found another way with PHP:

<?php
// get main image URL, or if not available use default image
$mainImageURL = "{video-image}";
if ($mainImageURL == '') {
$mainImageURL = "/images/site/default-prog-image.gif";
}
?>

I then just echo $mainImageURL whenever I need it. So all working, but slightly confused still why I couldn’t get an IF/ELSE statement working inside the File tags…

       
pixelpie's avatar
pixelpie
11 posts
15 years ago
pixelpie's avatar pixelpie

Hi there, I’m having trouble with the {count} parameter.

When I try to display it inside the variable pair, it displays the count of the weblog entry.

Am I missing something?

My code is:

{exp:weblog:entries weblog="sculpture" limit="1"}
     {sculpture_image}
          Total Results: {total_results}
          Counter: {count}          
     {/sculpture_image}
{/exp:weblog:entries}

The total results displays correctly, but the count gets stuck in 1 everytime as if was displaying the {count} from the {exp:weblog:entries} tag.

Anyone knows what could be wrong?

Thanks!

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

Guys– I strongly suggest you check out nGen File as a replacement to the no-longer-in-development File extension:

http://ellislab.com/forums/viewthread/110252/

       
ramonekalsaw's avatar
ramonekalsaw
377 posts
15 years ago
ramonekalsaw's avatar ramonekalsaw

After upgrading from 1.6.7 to 1.6.8 when I try to log in to the Control Panel I’m getting this error message:

– Unable to load the following extension file: ext.mh_file_ext.php.

– Now I only have ext.cp_jquery.php and index.html in my Extensions directory in my System directory but I can’t log in to my control panel.

Help?

       
Peter Lewis's avatar
Peter Lewis
280 posts
15 years ago
Peter Lewis's avatar Peter Lewis

Did you remove all the other extensions to try and solve the problem, or did you remove them before the upgrade? When you removed them did you disable them first?

Try placing the ext.mh_file_ext.php back in your extensions folder.

Re-reading your post - can you log in but can’t see the control panel, or can you not even get to the login prompt?

Can you go straight to the extensions list by adding “C=admin&M=utilities&P=extensions_manager” onto your URL and possibly disable all extensions?

Failing that, try editing the database table: exp_extensions delete any rows that have “Mh_file_EXT” in the class column.

       
ramonekalsaw's avatar
ramonekalsaw
377 posts
15 years ago
ramonekalsaw's avatar ramonekalsaw

The problem regarding extensions is discussed in this thread. Thanks for your help.

       
First 60 61 62 63 64

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.