I need to see a real-world working example of template tags for Mark Huot’s File extension.
I have successfully uploaded an image with the extension, and verified that the file is on the server. The name of the custom File field is “news_image_1”. Here’s my template code:
I get the title and body fields outputted fine, but nothing else at all. The “File” template tags are right from the extensions docs. Any idea what’s wrong? EE 1.6.4, PHP 5.2.6. Thanks.
Note that it’s both being resized to the maximum image size set in the upload prefs and that it is now a GIF. It ballooned from 216k to nearly 3mb in the process.
How come you “took it off the thread”? I’m having the same problem (no output) and would have liked to hear the answer you gave.
This thread is already 38 pages, and I didn’t think having essentially a 1-on-1 conversation in it was helping the whole community anymore. The person was using the extension incorrectly—it wasn’t a problem with the extension. Just trying to keep the thread as clean as possible.
Did scottmoa‘s post help?
Scottmoa:
scottmoa - 20 September 2008 11:10 PM
Images uploaded are being converted from nice pretty jpegs to crunchy gifs, making them HUGE files and ugly.
Does making the following change in the extension code help?
Regarding the length of this forum topic: This is what Mark Huot gives as the “support” link in his docs for the File extension. So obviously his original intention was to keep the whole discussion here. I completely agree that it’s unwieldy at this point. Mark should handle support a different way, but apparently he’s not supporting the extension anymore at all—as evidenced by his absence from the discussion of the JPEG mangling bug; a bit more on that below.
I was getting no output because I wasn’t wrapping his “custom field” tag in an HTML image tag. But his docs don’t say to do that, and I’m not a mind reader about what someone’s code does and doesn’t do. So, if you want an image to appear, you need an HTML image tag. However, if you’re using the “File” extension to allow the upload of ALL file types, not just images, then obviously you DON’T want to wrap your “File” field tag in an image tag. But I’m not dealing with that scenario here.
Here’s what works if you’re just trying to upload and resize an image, and then use it in a posting—which probably covers 90% of people. In this example, my weblog is named “news” and my custom “File” field is named “news_images”. If you have your “File” field set to allow multiple uploads, the following code will output all of them; if not, it will just output the single image you’ve allowed people to upload. Obviously, in addition to the HTML image tag I have here, you’ll do HTML for other fields (like title and body) and you’ll handle your CSS any way you want (I have inline CSS for this example):
(BTW, to make this Forum post work, I had to use HTML entities for the left and right angle brackets of the image tag in the code above, otherwise my img src and the contained {file_url} wouldn’t show up; can’t that be fixed in these Forums?)
If, in Admin > Weblog Administration > File Upload Preferences (where you define your special upload destination), you have “Keep Original” set to “yes”, then you need to use {file_thumb_url} in the image tag above, NOT {file_url} because {file_url} will be for the original uploaded (and possibly gigantic) image file and {file_thumb_url} will be for the resized version that the “File” extension creates upon upload.
Regarding the bug where the “File” extension turns JPEGs into nasty GIFs masquerading as JPEGs: the bug is definitely there in “File” extension v.3.1.1, and the fix here works. Here’s another thread from these Forums where it’s also mentioned that you can control the quality of JPEG created:
1. I can’t see the “Remove”-check box in the CP. JS is active, cause I’m using some jQuery in the front&back;-end.
and
2. if I use this extension only for uploading images, is there a chance to assign a caption to each image? (I know, there is a way with reverse related entries)
1) What exactly are you *doing* with jQuery that’s intefering? The mere inclusion of the jQuery framework (with a script tag in your page head) should not be doing anything to the display of those checkboxes.
2) I see no capability in the “File” extension itself for this. For single images only, you could easily define an additional field in your field group, put the caption there, and then bring that field in with your HTML. If you’re using the extension for multiple file upload, I see no obvious captioning solution. Anyone else?
1. i’m using Leevi’s Poll Extension, wich does work with jQuery. Even the CP got it loaded. Probably Mark’s extension works with prototype, or?
2. Yeah… I guess there is nothing outside. Probably there is the chance to code it on a funded base. There are heaps of threads who looking for a “weblog gallery” solution not a gallery, nothing reverse related entries, etc..
Nice would be file-uploading via Mark Hout’s ext. optional add caption and all ajax based. but i know, there is a hassle about the how to for a good workflow.
I’m using the fckeditor in backend and frontend. wich works great. I saw a plug-in (badly no link provided) to use templates in fckeditor for input images, caption and alterante text.
Should we move this to a new thread?
Excellent!
That appears to have solved the jpeg/GIF conversion issue. thank you!
Now I only have one issue - it’s still resizing it to the maximum image size set in the upload prefs. Ideally, it shouldn’t touch it at all if the image is within those parameters. This resizing is both increasing the file sizes and, as you know, with each manipulation there’s a drop in image quality.
Any guesses?
In the mean time, I’ve simply removed the maximum dimensions to prevent any resizing.
Wow this thread is really long eh? (If this question has already been answered on this thread I apologize)
It sounds like when a file is uploaded using the ‘file’ extension, that it automagically creates thumbnails for those images. Mine doesn’t seem to be doing that, is there a setting that I need to set? I imagine that in my upload directory there should be the image I uploaded and a thumbnail of it. (I’m not seeing any thumb files)
It shows thumbs when I am editing weblog entries, but when I call the {file_thumb_url} variable, it doesn’t link to anything. Does it matter what kind of image file I upload, jpg or gif?
Here’s some code I use to call the thumb image:
{exp:weblog:entries weblog=“portfolio” limit=1 dynamic=“off” status=“Featured”}
I read about 50% of this thread and didn’t find a problem or solution similar to what I’m experiencing on a client site. During development on our own server File worked like a charm. However, we moved the dev site to production on the client’s server last week and now File doesn’t work. Specifically, the file/image doesn’t get uploaded to the server. I confirmed this by looking via FTP.
Of course, I checked, double-checked and triple-checked all settings. Everything is correct. Previous images that were uploaded on the development site are showing just fine on the live/production site. I should mention this live site is hosted at GoDaddy (yeah, I know…).
Also, I checked the regular file upload that comes with EE and that works as its supposed to. It’s definitely something with File. Can someone please help? I have no idea what the difference may be or where to start troubleshooting.
Previous images that were uploaded on the development site are showing just fine on the live/production site.
Usually when this happens, your paths are still pointing to other server. So you move the files over, move the database, but unless you change the upload paths, the images are going to come from original server.
I move databases from dev, to staging, to production, and vice versa all the time. I have no problems.
What we choose to do is: never move DB from dev to production. Always from production to dev. So when I custom fields for example, I create them on production, export the DB and import it into dev. Then I go over the paths to point at dev. This way you can never break production.
Take a look at the images I uploaded. One is production settings and the other one is dev settings.
Usually when this happens, your paths are still pointing to other server. So you move the files over, move the database, but unless you change the upload paths, the images are going to come from original server.
Very true. And I checked that thoroughly because I’ve had that little bit bite me in the rear before. But apparently something wasn’t right… I just checked things today and everything’s working. In all the checking and editing I must have changed something to the right setting. Guess a good night’s sleep is better than anything after all.
I really like the nice interface and ease of use. Is there anyway to leverage this to associate files on the server that have been uploaded by ftp? If not, are you aware of any other options for doing so?