I’m trying to get this extension to work and have been successful with new images, but cannot figure out what’s needed to make it play nice with already existing images.
I’m using a weblog as a gallery and all of my existing images have been uploaded the usual way inside of the EE publish page and I’ve selected “Insert URL” as the setting when uploading. To display the image I’m using:
When I go back in and look at the existing entries inside of my “gallery” weblog, it shows the correct file name for that “file” custom field but it has that same {filedir_X} appended to the beginning of the file name and I noticed that when uploading a new image it does not have the {filedir_X} appended to the front of the file name. I assume this is because you have to manually specify and upload destination for each file custom field so it already “knows” where the image is stored thus the extra URL info is not needed?
Thoughts on how to get my existing images to work?
I’m confused on what you’re trying to do here. The file field can’t access already existing images as far as I know. It has nothing to do with galleries. You just upload the file using the custom field, and it uploads it to the directory you set using the settings you’ve entered. If you don’t upload a file while in a specific entry, it has no way of knowing which entry each pre-exiting file is associated with.
Sorry for the confusion. I realize it doesn’t have anything to do with galleries, but I was attempting to explain my setup. I’ve created a gallery (a few months ago) using a the weblog as a gallery method (instead of the gallery module).
I was able to get the File extension to work perfectly when creating a new entry with picture upload. What I wasn’t able to figure out (and this may not be possible, but what I’m trying to figure out) is if there is a way to change all existing images in my gallery over so that they work with the File extension? By going into my weblog administration custom field settings and changing my image custom file from “text input” to “File” type, this makes all of my existing images not work and I’m just looking for a way to fix that without going in and re-uploading all of the existing images.
Now I understand! Unfortunately I don’t think there’s a way to easily do it, but you may be able to do it with some clever SQL conversions. As far as I know, File stores the picture path information in the database as a text string, delimiting with \r between a file and it’s thumbnail, and \n between different files. There’s also a \r at the end of the string in a File field set for multiple = yes. So, it may be worth writing SQL to fill out the file field automatically given the database entries for the other field. Make sure to play around on a database copy before doing anything on your production one though!
The other thing to consider is just making File a new field, and using a conditional statement in your template to see if the image is there using File, or the gallery field.
Yep, that helps out a lot! I might give the conditional statement route a try because the words “clever” and “SQL” aren’t in my vocabulary. I know zero SQL.
One piece of advice: don’t use if:else with them, only simple {if}{/if} conditionals (you can use {if imageUpload != “”}foo{/if}{if imageUpload == “”}bar{if}). I’ve seen weirdness when using the advanced conditionals with it.
Firstly to Mark Huot a big THANK YOU for publishing this extension. It is great.
I’ve got an issue that seems to have cropped up before but doesn’t seem to have found a resolution yet.
Via the First Party uploader I can upload images and resize them correctly and they output with the correct MIME type. 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.
I’m using the GD2 Library for the resizing and have the following config in phpinfo()
GD Support enabled GD Version bundled (2.0.28 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.2.1 GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled
I’m running this on Apache 2.2.3, PHP 5.1.6 on Centos 5.2
Looking through the extension code I’m not sure that MIME type gets set?
One piece of advice: don’t use if:else with them, only simple {if}{/if} conditionals (you can use {if imageUpload != “”}foo{/if}{if imageUpload == “”}bar{if}). I’ve seen weirdness when using the advanced conditionals with it.
Great extension - you’ve saved me a world of hassle with this - thanks!
Having a small problem in that the image resize method defaults to Auto all the time and I can’t seem to change it. I have Max Width and Min Width set, but every time I go back to the file upload preferences it still says Auto.
Is there a setting I’m missing? Everything else works fine.
Apologies if this has been asked before (but it’s a very long thread): is there a way to be able to upload files with the same name over the top of ones that already exist? By default it throws an error message about duplicate file names.
Well there are two things that you can do about that. One is that when you get the warning you can click on the check-box that appears at the top of the publish page and then choose the image / file again and re-upload it. You should then notice that the file now gets called the same name but with something like _1 appended to the end of the name before the file extension.
The other way is to use the option in the File extension to make it re-name all files for you anyway. This means that any file that gets uploaded is completely renamed and has loads of numbers and letters in its file-name. If you aren’t fussed about what the files are called then this is the absolute easiest way to go but if you are going to need to be able to find the images / files at a later date then this could cause problems. Both have their merits in one way or the other but totally depends on which way you need to use the files once they are uploaded.
Not really, because I have one part of a site I’ve been working on where the navigation is based on the file name so it needs to be in the same format and if the client ever needs to replace a file, they should be able to upload a new one with the same name and replace the previous one (although they’re unlikely to do it very often and the files are on the large size, so it may just be easier to FTP new files over the top of the old ones).
Tyssen—why not delete the file using the extension, the reupload the new one? If it’s the same name your navigation should still work.
That would have been my next suggestion but I wasn’t sure if the file you were trying to upload with the same name was in the same entry or not though?
If it is indeed in the same entry then no problem just go ahead and click on the remove check-box and then choose the new (same-named) image and everything should be fine. If the image / file is in another entry then you wouldn’t be able to do this as you wouldn’t be able to have two files of the same name in the same upload directory.