I am uploading an image but still receive this error: "It is required that you upload an image for your image advertisement.". The image successfully uploads and permissions are set correctly. The error does not allow me to create an image ad. Need help.
Comments
Comment #1
Jon_Ashdown commentedCan confirm bug, although on my install (drupal 6.14, ad 6.x-2.1), the image is not uploaded.
There is a workaround - not the best as it requires ftp access to the server (in fact its not a workaround at all) :
go to administer/content management/ads/settings/image ad.
in the "general settings" section, tick the "Allow remote hosted images" box and save the form.
ftp to your your site and navigate to somwhere sensible - e.g sites/default/files....
upload the image and make a note of the url
now you can create the advert, in the "remote image path" enter the url of the image
yuck
Comment #2
jeremy commentedI believe this is a duplicate, and is now fixed:
#446262: "Unable to locate image" error when trying to add an image ad
Comment #3
charlie-s commentedWas having the same issue. Not related to the "unable to locate image" bug. If you have file uploads un-listed by default (or just happen to uncheck it in this instance), you'll get this error.
Comment #4
IGadmin commentedCan you please be a bit more specific about "if you have file uploads un-listed by default (or just happen to uncheck it in this instance)" - I'm unclear where to look for this. Thx.
Comment #5
charlie-s commentedThis is in the file upload listing -- you need to check the box that says "list file". If you edit a content type (Admin >> Content Management >> Content Types >> My Content Type) you should see an option somewhere in the lower portion of the form to "list file attachments by default"; if you have that unchecked than files will not be listed by default.
Comment #6
IGadmin commentedAppreciate the additional detail, but nothing of what you wrote seems to correspond to my install. Am running Drupal 6.22, ad module 6.x-2.x-dev. I don't have a section on my Advertisement content type with an option to "list file attachments by default". I only have an attachments enabled or disabled set of two radio buttons under the workflow settings of the content type. No file upload listing, no list file checkbox on the Advertisement content type. No "option to "list file attachments by default." Is this a D6 vs. D7 issue?
Comment #7
charlie-s commentedMy bad, the "List files by default" is at example.com/admin/settings/uploads.
When you attach a file to a node via the "File attachments" fieldset you should see 2 checkboxes next to the file, 1 that says "Delete" and 1 that says "List". You simply want "List" to be checked.
Comment #8
IGadmin commentedThanks for the clarification, but my problem appears more fundamental. I can't seem to attach a file to the node at all. I try attaching a file with the file attachments fieldset (i.e. by navigating to the file and pressing the attach button) when creating a new advertisement node, and Drupal responds with the error message "It is required that you upload an image for your image advertisement." The file DOESN'T attach to the node. Have only got image ad types enabled, not HTML, text, etc.
I can attach files to other node types on my system without problems, but not to the advertisement node type. Dunno why. Trying to do this with user ID 1 (administrator), and permissions appear to all be set properly to allow the admin role to do everything on my site to all node types, but my files just don't attach to the advertisement node type. Other node types are fine. All the permissions are even toggled on for the admin role at /admin/content/ad/configure/image. I'm flummoxed!
Comment #9
charlie-s commentedIGadmin, try navigating to the file and then pressing the "upload" button -- in other words try to upload the file without saving the node. Does it upload? Do you get any errors? If you are in Chrome, press CMD-Option-J (Mac) or CTRL-Alt-J (Windows) to open the console and see if you have any JavaScript errors when attempting to upload. Or if you're in Firefox use Firebug to check the JavaScript console.
Lastly, check the recent error log @ admin/reports/dblog to see what's happening when Drupal/PHP attempts to save the file.
I would guess that the file is attempting to be moved into a folder that either doesn't exist or PHP doesn't have permission to write to it.
Comment #10
marcolav commentedI am having the same problem, I have tried all possible combinations.
Hit attach without saving, select ad type or not, save without attach to try and attach later. I still get the same damn error!
Comment #11
bodyblueprinter commentedI am using Drupal Commons and when give a role based permission to create ad, there is not a File upload form visible. File upload form is visible for groups and such, just not for ads.
Comment #12
HJulien commentedI am getting something similar with 6.2.4 with image ads. Sometimes the file won't attach no matter what I try. Some times, it attaches partially - the image info appears but nothing else and I can't get past that. The times it works is when the page refreshes and actually shows the image and the mouseover and url input boxes. If the image ad actually appears and I save it a second time, it works.
This is very weird and unstable behavior. I don't understand why the image doesn't always attach - you can see it listed with the image info i.e. size. I also would have thought the mouseover and url would be conditional fields for the image ad type but shouldn't require a save before they appear.
Another issue is that when I edit an ad that worked, the image and the content of several other fields are lost. This is not ok behavior for my site.
It makes me too nervous to allow my users to create ads under these circumstances. Like many others using this module, my site depends financially on it working. If the module maintainers could help with a fix or explanation, it would be very much appreciated.
Comment #13
lrwebks commentedDrupal 6 is EOL and no longer supported. Closing this as outdated for that reason. Thanks for your contribution!