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

glamorous_be's avatar
glamorous_be
19 posts
16 years ago
glamorous_be's avatar glamorous_be

Hi,

I have a problem with the last File extension. I’ve explained my problem here.

In short: When an error occures while uploading a file (to large, filename exists, …). Expression engine cleared my dates to 1970-1-1

Hope somebody can help me!

Thanks!

       
tpayton's avatar
tpayton
172 posts
16 years ago
tpayton's avatar tpayton

Anybody able to resolve the issue with the settings now showing up in 3.1.1 in the admin > utilities > extensions?

There’s a glitch in the extension where those settings can be hidden sometimes, and you have to set them via the database. Where are you setting auto?

I can’t find where to set them in the database either.

Help!

       
glamorous_be's avatar
glamorous_be
19 posts
16 years ago
glamorous_be's avatar glamorous_be

These settings are not shown under utilities but I can help you with the database-item:

name_database > exp_mh_file

In this table you can set all the settings from a particular upload preference (exp_upload_prefs)

       
tpayton's avatar
tpayton
172 posts
16 years ago
tpayton's avatar tpayton

Ouch. I think I will hold off on upgrading to File 3. I’ll just make due with version 2. I hate to be dependent on modifying a database table directly.

Thanks for the help!

       
SC CTSI at USC's avatar
SC CTSI at USC
7 posts
16 years ago
SC CTSI at USC's avatar SC CTSI at USC

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>.

1) I’ve tried giving Everyone permissions (equivalent to Unix permissions 777) for ALL my directories. This didn’t fix the problem, so I am thinking it’s not a permissions problem.

2) I’ve made the preferences for The File Upload Location to the least possible, ie. I set to Do not resize image, do not allow multiple downloads etc., but it still doesn’t work.

3) GD2 is installed and enabled according to phpinfo.

Any suggestions from anyone who has got this working on Windows Server 2003?

       
outline4's avatar
outline4
271 posts
16 years ago
outline4's avatar outline4

hi I’m having difficulties with resizing the images. I have tested several setups and run into problems with each…

  1. I can’t switch to “Do not resize” in file upload prefs. That’s bizard, but if I don’t specify anything in the max width or max height, the file is untouched…

settings:

allowed file types [images] maximum image height [] maximum image width [] allow multiple [yes] show thumbnails [yes] clean filenames [no] rewrite filenames [no] resize images [I can’t switch it to “do not resize” it goes back to “auto”] keep originals [yes] delete from server [yes]

  1. I get very poor results from resizing images. I would like to automatically strech my images to the given values in file upload preferences, but I get very poor results. and I don’t know where I could tweek the settings. has anyone obtained good results?

settings:

allowed file types [images] maximum image height [344] maximum image width [700] allow multiple [yes] show thumbnails [yes] clean filenames [no] rewrite filenames [no] resize images [stretch] keep originals [no] delete from server [yes]

I discuss this on antother thread aswell: http://ellislab.com/forums/viewthread/72506/

  1. I would need some sorting possibilities within the variable pair in the template. is there a sort tag somewhere? like {image_file sort="asc"}{file_url}{/image}. is there another way to sort them? I would like to display the last uploaded image as the first… this makes sense if I contiually add pictures to the same post… this would be really helpful!

greetings stefan

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

I’m not sure why you can’t set the do not resize setting. Does it error or just not change? Can you try changing it directly in the database?

As far as the quality goes, this post earlier in the thread can help: http://ellislab.com/forums/viewreply/335581/

And there’s no sorting built in. To sort them, you can run the loop into a php array and then reverse the array.

       
outline4's avatar
outline4
271 posts
16 years ago
outline4's avatar outline4
As far as the quality goes, this post earlier in the thread can help: http://ellislab.com/forums/viewreply/335581/

It really did save me a lot of work! that’s great! seems very important, so I’ll post the code again. (for me the file component was useless until I changed this code)

Change from:

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

Change to:

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

This will take care of your problem and save your jpeg as a true jpeg. The default image size is set to 60% quality (this is medium in Photoshop)… if you want it set to a higher quality add the number below. (90 means 90% image quality)

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

thank you so much! stefan

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

In the database, it’s the exp_mh_file table.

For php– I don’t have a lot of time now so this php may be wrong and/or sloppy, but the general idea is (php must be set to output):

<?php 
    $picURLS = "{produkte-bilder backspace="1"}{file_url}|{/produkte-bilder}";
    $picNames = "{produkte-bilder backspace="1"}{file_name}|{/produkte-bilder}";
    
    $picURLArray = explode("|",$picURLS);
    $picNameArray = explode("|",$picNames);
    
    array_reverse($picURLArray);
    array_reverse($picNameArray);
    
    for ($i = 0; $i < count($picURLArray), $i++) {
        echo "<li><img ></li>";
    }
?>
       
outline4's avatar
outline4
271 posts
16 years ago
outline4's avatar outline4
In the database, it’s the exp_mh_file table. For php– I don’t have a lot of time now so this php may be wrong and/or sloppy, but the general idea is (php must be set to *output*):
<?php 
    $picURLS = "{produkte-bilder backspace="1"}{file_url}|{/produkte-bilder}";
    $picNames = "{produkte-bilder backspace="1"}{file_name}|{/produkte-bilder}";
    
    $picURLArray = explode("|",$picURLS);
    $picNameArray = explode("|",$picNames);
    
    array_reverse($picURLArray);
    array_reverse($picNameArray);
    
    for ($i = 0; $i < count($picURLArray), $i++) {
        echo "<li><img ></li>";
    }
?>

I’m unshure where to put this… do I have to replace it with the following code? or do I have to put it below?

{produkte-bilder}
    <li>{file_url}</li>
{/produkte-bilder}

from my point of view and what I understand in php (basically nothing) there is something missing in the echo line? but then, I understand nothing…

thanks already for your time! I would like to offer you a drink! next time you’re in switzerland for shure! stefan

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

You’d replace it to make your pictures reverse.

And it looks like the forum stripped out my echo code when I escaped slashes. Try this, without escaping:

echo '<li>'.$picURLArray[$i].</li>';
       
outline4's avatar
outline4
271 posts
16 years ago
outline4's avatar outline4
You’d replace it to make your pictures reverse. And it looks like the forum stripped out my echo code when I escaped slashes. Try this, without escaping:
echo '<li>'.$picURLArray[$i].</li>';

hi thanks a lot! it does work, but it takes the same order 😉 how can you count from the last to the first in the “for” loop?

this must be real easy for you? a braina for me 😊 thanks so much already!

       
outline4's avatar
outline4
271 posts
16 years ago
outline4's avatar outline4

I did it myself 😊

<ul id="home_img">
                <?php 
                    $picURLS = "{home-foto backspace="1"}{file_url}|{/home-foto}";
                    $picNames = "{home-foto backspace="1"}{file_name}|{/home-foto}";
                    
                    $picURLArray = explode("|",$picURLS);
                    $picNameArray = explode("|",$picNames);
                    
                    array_reverse($picURLArray);
                    array_reverse($picNameArray);
                    for ($i = count($picURLArray)-1; $i > -1; $i--) {
                    echo '<li>'.$picURLArray[$i].</li>';
                    }
                ?>
            </ul>

it’s such a relief for me! thank you very very much! highly apreciated!

stefan

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

I told you my php would be sloppy…let’s try this one more time…

Edit: looks like you got it!

       
grantmx's avatar
grantmx
1,439 posts
16 years ago
grantmx's avatar grantmx

I get this error often, even when the files are uniquely named:

… – The file ‘7322d4c98742b28e6f642782ef7f9ff2.jpg’ already exists, please rename your file before uploading it to the server. ( Automagically rename this file the next time it’s uploaded?)

I’m using this tool for a number of custom fields on my publish page.

Haven’t searched through the 36 pages of posts to this thread for the answer, but does anybody know of a fix?

       
First 41 42 43 44 45 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.