Hi,
I'm having problems with uploading files and pinpointing what might be the cause. I've searched through the forums and the most I've been able to come up with is that it might be a browser issue, or it might be a php.ini setting issue. Neither of which seem to be right to me for the reasons I outline below.
What happens:
I browse for a file, select it, upload it, the file appears as it should on the edit screen, then after I submit the form, no file shows up. I go back to the edit screen and there's no file listed. Nor is there any error during this whole process.
Maybe it's a browser issue? (although it never has been in the past):
I can consistently get it to work in IE7 (I normally use firefox). However, there are also two other staff here who use IE7, one person can never get it to work, and the other has had it work for her sometimes and not others. But in Firefox, safari, and opera...it doesn't work at all.
Maybe it's a settings issue?
I've checked the file upload and php.ini settings. But those seem to be OK. Unless the settings in the site admin being different from php.ini makes a difference. All the user roles are set in administer > site configuration > file uploads to a max size of 10MB. The php.ini file is set to 5MB. However, none of the files we've been trying to upload are anywhere near 5 or 10 MB. There's "no value" for upload_tmp_dir in php.ini but I do have a temporary directory set in Administer > site configuration > file system so I don't know if that makes a difference. I have a file system path set.
Other useful information:
1. We just upgraded the site from a php4 to php5 REHL 5 server about a month ago. But this seems to have started in only the last couple of weeks and it probably worked fine on our development site. I only say probably because there wasn't a lot of need to upload files going on in the development version of the site. So I'm not 100% sure that I would have noticed the problem until now. But I never use IE in normal site work, so I would think I would have seen this problem at least once in the past 3 months if it were a php4 vs 5 issue.
2. We use a public file system
3. We are running Drupal 5.9
Please bear with me if I should explain things better or submit this as an issue. I am new to the forums and also new to dealing with these kinds of backend issues.
Thanks in advance for your help.
Cheers,
Kristin
Comments
This is a magnificent
This is a magnificent example of a perfectly written request for assitance! Bravo Kristin-- and thank you. I was beginning to lose faith in the ability of human beings to be able to write clearly and descriptively.
Now as to your problem, there are 3 settings in the php.ini you need to set correctly for your files:
Once you've set them, verify them by creating a phpinfo.php file in your drupal root and opening it with your browser:
Couple of other things to try-- clear the drupal cache, clear the browser cache, make sure cookies are enabled, clear the tmp dir on the server, check the drupal watchdog report (admin/logs/watchdog) for any error messages (post back if you see any).
After clearing the tmp dir try again-- are there any tmp files created?
Try configuring the garland theme to a different color-- does it work?
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Thanks for the compliment
I don't have high enough server access to my php.ini file but my IT department sent me a link to get my phpinfo settings.
upload_max_filesize: 5M
post_max_size: 8M
max_execution_time: 30
But these all seem high enough for what we've been doing.
I'm not sure how to clear the Drupal cache...can I do that through the admin interface or do I need to do it directly to the database tables (I looked through admin but didn't see anything)?
I also don't seem to have access to my tmp directory...so I will inquire with my IT dept and get back to you.
Thanks for the suggestions and I will let you know how it goes as I get more information.
Like I said, troubleshooting these kind of backend issues are new to me, so I might be a little slow in that department...I'm much more of a designer, IA type...but I'm learning, right?
Cheers,
~KC
You might want to bump the
You might want to bump the max_execution_time, but if you don't have access you can try that after the other options have been exhausted.
In d6 there's a button to clear the cache but since you're on d5 see http://drupal.org/node/152983.
Also, did you try change garland's color? (this may seem odd, but it will help to diagnose whether or not there's a permissions problem and shouldn't require you to wait for IT).
And what about watchdog messages?
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
I'm reading up on the clear
I'm reading up on the clear cache option you mention. I do have the devel module installed, but disabled at the moment because it causes a bunch of php errors when it's on. It doesn't break the site, it's just annoying to get all those errors.
I haven't changed the theme color yet...but I'm just curious, for a newbie like me, it does seem like an unlikely way to diagnose a problem...what kind of permissions issues would that detect? The Unix permissions on a particular directory? And what would be the result if I changed it (php error, it wouldn't change, etc.)?
There are no watchdog messages at all...everything appears to work fine until you submit the page and then no document appears. I get no errors at on the page, nor any watchdog errors in my logs that could be related to any upload action.
~KC
PS...have patience with me, because I only have you all and a couple of good friends who know drupal to rely on. I also don't have a development space currently set up yet to try things out on...so, I take very tiny steps since everything I do is to the live site.
changing the color of a
changing the color of a theme saves some color specific settings in the /files directory-- so if it doesn't work it's likely there's a permissions problem.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Can you explain why you
Can you explain why you don't have access to your tmp directory, since you said that you have set up your own tmp directory in Administer > site configuration > file system ? Have you created that directory yourself (preferably outside your public_html and using a full file path) and set its permissions to 777 ?
Does the admin/logs/status page complain about anything?
I didn't set up my own temp
I didn't set up my own temp directory...I just meant that it was set to something, being the Drupal default, which is at the server root...so I don't have that kind of access to make any modifications to that folder or look inside. The permissions are set to 777 though. (I figured this all out using my ftp client)
I get no watchdog error logs of any kind, which is part of what makes this puzzling. Along with the inconsistent behavior of the problem.
For instance, since this problem started, I have managed to upload papers using IE7 but today I'm having trouble.
A friend thinks it might be the group that my files directory is set to (again, not something I can change)..so I'm inquiring about that too.
It's really strange.
~KC
PS (I'm not very good at ssh, just so you know)
You could create a tmp
You could create a tmp directory yourself, just outside your web root, set it to 777 and use that in your file system settings, so that you can watch if anything is being uploaded there during the process. Also, is anything being uploaded in your files directory?
Are you using just the core upload module?
I remember a few issues with uploading in the past. One was happening when magic_quotes_gpc was On in php (although only in Windows...) and was solved with a
php_value magic_quotes_gpc 0line in Drupal's .htaccess. Another one had to do with mime types and filename extensions and depended on the server configuration, so check if the problem happens with a plain .txt file. Some other issues were javascript related, sometimes having to do with browser or firewalls settings.Have you ever come across an error message about "open_basedir restriction in effect"? Or about "safe mode"? Is there anything about open_basedir or safe mode in your phpinfo?
Yep-- agree w/ everything
Yep-- agree w/ everything cog.rusty said-- definitely create your own tmp dir (and update drupal to reflect that). Then try again and see if anything appears in either the files or tmp dir.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Well the color change to
Well the color change to garland worked just fine....and it's going to be highly unlikely I can get my own tmp directory outside of my root. But I'll try. ~KC
Can you tell I also have little control over anything outside of my own drupal install? :0(
It can be inside your web
It can be inside your web root or anywhere. I just said outside to keep it safe from web access.
OK.... so we've tried the
OK....
so we've tried the temp directory (changed the admin setting and set the permissions to 777) - no temp file created upon trying to upload another pdf.
Looked at server logs (at least in the directories I could get to) - Nothing, no errors related to any recent time periods (I'm now trying to get access to the live server logs).
Had IT department check the permissions on the files directory. They did change the group it was assigned to, but it still didn't fix the problem.
Cleared drupal and browser cache - again, no change.
I'll let you know what I find out from the server logs...if anything.
UGH. Thanks for your speedy responses...this is very helpful despite the frustration.
~KC
did you try changing the
did you try changing the color of garland yet?
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Yeah....and it worked fine.
Yeah....and it worked fine. ~KC
I also just got a copy of
I also just got a copy of the live server logs and nothing seems out of the ordinary. ~KC
At this point i would
At this point i would probably try bumping up the max execution time to something huge and see if it makes any difference.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Once again...no luck...I
Once again...no luck...I think I've run out of options. ~KC
One last try with the
One last try with the basics... Are you using just the upload module included in core?
Did you say that the file is not uploaded in your files directory at all, or just not showing?
When uploading a file
- do you click the "Attach" button before the "Submit" button?
- Does the progress bar show uploading activity when you do?
- After that, is the "List" checkbox checked?
- Does the file path listed there seem right?
Yeah.....I've been through
Yeah.....I've been through the basics a few times myself...like how many times can you check to see if the stove is shut off before you wonder if you are OCD? It's good to ask though.
Yep...just the upload module
Yep...attached
Yep...progress bar
Yep...list is checked and a path is there and as it should be. I'll usually add a link to the PDF in the body text so I can test it that way too.
Yesterday, on a page node that had previously had a bunch of papers uploaded to it. Not only couldn't I upload a new paper, but none of the old ones showed up. Luckily the links are coded to the body text so you can still get the papers. They just don't show up under "file attachments" on the edit screen....but the new file I tried to upload never even made it to the server, so when I clicked the link I made...page not found, and then I confirmed that by going to the server itself.
another random thought-- if
another random thought-- if you have additional modules beside core, try turning them all off and test upload again-- if it works, then enable the modules one by one and try uploading until to you find the one causing the problem.
another possibility-- try the filefield module and see if uploads work that way.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
I'll test out your installed
I'll test out your installed modules suggestion, but I'll have to do it sometime when things are "quiet" on the site. Right now I've got too many meetings and content updates to manage that. I also have no dev version of the site right now, so I would be nervous about installing new modules. I should also hear from the developer I worked with previously on the site soon....I'm thinking an upgrade to 5.10 or even 6 will fix this mystery problem (just a hunch really).
So I'll keep plugging along on this....just not as furiously as it has been for the last week or so. Thanks again for all your help...and I will keep you informed of any changes or fixes (hopefully!)
~KC
New Development
I haven't tried turning on and off modules yet...just haven't had the time to devote to it. But.... Someone in my IT department has been helping out with testing too and noticed some interesting behavior. He thinks that the ajax in the attach button is buggy.
Here's how things have been working lately for a few of us who have been trying to upload files in the past couple days.
IT staffer: I set him up with a login yesterday and made a test page for him to upload files to. For him, every time he uploaded a file...the gray upload bar would just spin and spin and never finish the upload. These were small files some .txt, some .pdf. If he submitted or previewed the page before it finished attaching, the file showed up as it should...he would also end up with duplicates of the files. file.txt and file_0.txt
Another staff in my office: She has has had intermittent success uploading files for the past week or so. All day yesterday, it worked fine for her and she always uses the attach button, because she uses the resulting path to code the link into the body of the node. I don't know if it has worked for her today, I haven't gotten the chance to ask.
For me: Yesterday, I couldn't get any files to attach anywhere. Today, on some nodes I could and some I couldn't...but once I stopped using the attach button, it has always worked...so far. And I've tried it on nodes that were giving me trouble yesterday and earlier this morning. And I'm not getting the duplicate file issue, but for me I also don't get the ever-spinning attach bar. So I basically have been browsing for the file, choosing it, and then submitting the node. And the document appears in the little Drupal table at the bottom of the page as it should. And when I go back to the edit screen, it appears as it should there as well....with the list box checked and the path.
It's still weird, but hopefully this means there's a light at the end of this tunnel.
~KC
another thing to try in this
another thing to try in this vein-- try turning off javascript in the browser and see if that has any effect.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
That created all kinds of
That created all kinds of difficulties, usually resulting in nothing. And I tried turning it off and on at various stages of the file attachment and node editing process. If I just turned it off at the beginning of editing the node...i couldn't even get the file attachment area to expand so I could browse to the file.
~KC
i couldn't even get the
ok that's disconcerting-- disabling js should not make your site unusable-- the collapsible fieldsets should be expanded by default and you should be able to attach files just fine.
did you try refreshing / reloading the pages after turning off js?
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
OK....disabling the
OK....disabling the javascript didn't give me the problems it did before. I don't know why, but I'm not going to ask...I've got enough mysteries to deal with.
so...when I did disable the javascript...I got the same problem, the file wouldn't appear after submitting the node edits if I used the attach button....but if I skipped the attach step, it worked fine...so it must be something's up with the attach button.
I just got the security notice about drupal core for 5 and 6 so I'm going to move as fast as I can on upgrading, and hope that fixes the problem.
~KC
Hi if you are still watching
Hi if you are still watching this post. I've had a half resolution to this issue. We figured out it is something buggy about the attach button. If I skip the step of clicking it and just submit the page, the document attaches just fine. I haven't upgraded yet, so I don't know if that will fix it or not. But if any new developments happen, I will let you know. At least I can get the files to attach now.
Cheers,
Kristin
hmm.... how
hmm.... how bizarre...
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
This is probably no comfort,
This is probably no comfort, but I am still seeing this problem discussed in various threads, even between developers, even for Drupal 7. And the frustrating part is that those who don't have the problem can't reproduce it. They often mention FF2 as problematic and IE7 as OK, but from what you are saying not even that is certain.
Try to switch to a simple but stable non-core theme to see what happens.