Hi all,

I have a new problem, which doesn't seem to be related to anything that was done on the site. It used to work fine, and now suddenly does not.

We are using version 4.7.6 and can't upload an attachment at all - when I browse to a document and then click "attach", the gray bar just goes and goes forever. It never gives an error message, and it never finishes. My file does not appear in the /files/ folder, nor /files/tmp/ (in fact, I just manually created /files/tmp/ on the server since it was not already there and I thought that might have been part of the problem).

It doesn't seem to matter which user I'm logged in as, or which page I'm trying to attach a file to.

I think I have tried everything:

  • It is not a disk quota issue with the host
  • It is not a quota issue for the user (administer > settings > upload has plenty, both for per user and per upload, and the php setting limit per upload is also plenty)
  • I tried disabling favicon.ico, but I see that seems to be a 5.x workaround and I'm using 4.7.6
  • The permissions on both /files/ and /files/tmp/ are 777

Any more ideas?

Thanks,
Matthew

Comments

Chill35’s picture

When you upload using the 'Attach' button, the file is uploaded using Ajax. A final step is needed to complete the attachment which happens when you submit the posting.

- Have you tested in different browsers ? (different javascript implementations).

- If you don't use the Attach button, but submit the post after having browsed to the file, is the file uploaded successfully ?

Also, are you aware of your host upgrading PHP recently ?

Caroline
A coder's guide to file download in Drupal
Who am I | Where are we
11 heavens

mhofmockel@drupal.org’s picture

I confirm the same symptoms on both 5.1 and 4.7.6.
And as Chill35 has implied, AJAX seems to be the problem.

Indeed the file uploads fine when I don't use the 'attach' button or disable java in the browser.

tested IE and Firefox and both fail with java enabled.

Now what?

mhofmockel@drupal.org’s picture

My file attachment problem has been resolved by removing the Devel module.

Matthew OMalley’s picture

@mhofmockel - I do not have the Devel module installed.

@Chill35 - Thanks for the suggestions -

Using "Attach":
In IE6 and Firefox 1.5, it uploads.
In IE7 and Firefox 2, it does not upload.

Using "Preview":
In IE7, it uploads.
In Firefox 2, it does not upload (goes to a blank page).

I haven't heard back from my host yet about upgrading PHP.

Matthew
______________________
Grand Junction Design, LLC
Web and Print Design For
Nonprofits and Foundations

Matthew OMalley’s picture

Host says they did not upgrade PHP recently - server is running 4.4.4
______________________
Grand Junction Design, LLC
Web and Print Design For
Nonprofits and Foundations

devinhedge’s picture

I have replicated the same behavior under Firefox. Wouldn't know for IE as it isn't installed on Linux.

Christefano-oldaccount’s picture

I decided instead to simply remove the "Attach" button and added this to my style.css file:

input[value="Attach"] {
  display:none;
}

/* IE6 ignores display:none for buttons */
#attach-button {
  width:0px;
  height:0px;
  border-width:0px;
}

This isn't a permanent solution, of course, but at least the ineffective "Attach" button is gone. The problems I can see are (1) screenreaders will still see the "Attach" button and (2) multiple uploads are only possible by saving and editing the node over and over again.

This is crossposted at http://drupal.org/node/65153 (#comment-262464).

ceo3141’s picture

Hi -- thank you for posting this, I was going crazy trying to figure out what I was doing wrong. I am somewhat afraid to change the style.css file -- what if another module uses an 'Attach' button? Is it possible to put this hide code in the upload.module file?