I'm having an error with the private file system on a shared IIS hosting account through http://webcentral.com
It is not something I have come across and seems to me to be really quite unusual.
The website was developed on Apache and then migrated to the live server which is running IIS.
Initially this website was running Drupal 6.12 which is when I first noticed the issue, I upgraded to 6.14 in the hopes it would correct it but alas it hasn't.
When the website was first created, the file system download method was set to private as there are a huge number of files that need to be available only to authenticated users and administrative users. File permissions are controlled using the "File Access" module.
The actual problem is that Drupal doesn't seem to be able to find the files now. The issue didn't exist when it as on Apache at all.
The existing files cannot be found and return a 404 error (however, this error is returned by the server, not be Drupal, which seems odd to me).
In addition, the File Upload fieldset contains the following text:
File attachments are disabled. The file directories have not been properly configured. Please visit the file system configuration page.
When I visit the file system configuration page though, everything seems fine except for one thing.
The first is that Drupal cannot see the temporary directory.
If I view the source I can see the following code:
<label for="edit-file-directory-temp">Temporary directory: </label>
<input id="edit-file-directory-temp" class="form-text error" type="text" value="/tmp" size="60" name="file_directory_temp" maxlength="255"/>
<div class="description">A file system path where uploaded files will be stored during previews.</div>/tmp is the correct path, but in the error messages, both from the source and the regular error messages at the top of a Drupal page it tells me that /tmp does not exist. I have cleared the cache but not sure what else to try here to make Drupal see that it is there.
I had another issue when migrating the website, and that is that the IIS server does not support clean url's which I had setup on the Apache server. After disabling them on Apache and re-uploading the database to the IIS server, the website seemed to function fine and all the URL's were updated to the regular ?q= URL's, including the file download URL's.
I have tried switching the download method to public and back to private but that didn't make any difference.
Drupal is setup in the root directory of the shared hosting account and utilises the default sites/default/files folder for file storage.
It is running on MySQL version 5.0.27. I am uncertain as to what version of PHP is running, but I did have to install the Date PHP4 module in order to use the Date API and related modules.
I have also had some issues with FCKeditor not displaying, I am looking into this at the moment, I'm not yet sure if it is related or not.
Any thoughts on further things to try or advice on potential causes would be greatly appreciated.
Thanks in advance.
Comments
Comment #1
terramedia commentedThe FCKeditor issue appears to be resolved, so it would seem it is unrelated.
Comment #2
terramedia commentedThe PHP version is 5.1.1 - A little weird that I needed the Date PHP4 module in order for it to work then.
Comment #3
terramedia commentedI have now changed the location of the tmp directory, CHMODed it correctly and told Drupal where to find it. Upon doing so, it tells me a .htaccess file can't be found in it and cannot be created and that it needs to contain the following 3 lines:
After creating the .htaccess file and putting those lines in it, I'm no longer getting an error on the File System settings page, however, I cannot upload files.
It gives me the option to, and it appears to upload after I click Attach, but it doesn't display the file information after the loading bar goes away. If I save, the attachment isn't there. Nor is it on the server.
Also of note, existing files can now be found using the Private file system, however, they all download as index.php file names, if I rename them with the correct extension, they are fine, but that shouldn't be necessary. There are a few other threads about this part of the issue which I am yet to look at but will hopefully resolve this part.
Comment #4
terramedia commentedJust another update, I have found out it is running IIS6 and neither FastCGI or the rewrite module for IIS are available.
Comment #5
terramedia commentedIt seems to me that the issue relating to the files being named index.php is because clean URL's isn't enabled and hence even though you are downloading a file at that particular path, its still index.php, unfortunately, I cannot enable clean URL's.
I was also thinking a web.config that does the same thing as the above .htaccess might help. How would I go about setting something like this up?
Comment #6
terramedia commentedI have attempted to use the Web File Manager module ( http://drupal.org/project/webfm ) in place of the core upload functionality, it unfortunately seems to have the same issues with uploading files, it also won't show any files in the file manager that already exist.
It initially reported that the "server is unreachable", after attempting to upload a file anyway, it just sits on the "working...please wait" message.
There have been reports in the issue queue, such as http://drupal.org/node/603566 of a similar issue, but from their fixes, and the fact that they are still able to actually upload files I suspect this is unrelated.
Comment #7
terramedia commentedI have attempted to set the PHP default temp upload directory as Drupals default but unfortunately no luck.
Drupal still appears to upload the file but does not show the preview, simply asks if I would like to upload another file. When I save the page, the file is not attached and it is not on the server either.
Comment #8
gaxunil commentedI'm having this same issue as in #5 above with index.php trying to be saved for file attachment downloads instead of the name and type of the actual attached file. I'm using private downloads via the drupal file system settings. I do not have any rewrite module install and am on IIS 6.
Any guidance? Are clean URLs really the solution?
Comment #9
terramedia commentedI haven't gotten anywhere with it really.
For me they are now downloading as index.doc or index.pdf (depending on what the attachment is), I'm not sure what I did that got it to that point though, I've tried undoing things and it's still working, so I'm really not sure (Yay for Windows consistencies).
I suspect clean URL's are the easiest solution simply because when the browser receives a file request using the drupal filesystem it is usually address.com/index.php followed by the query string for the file location through the file system. Unless clean url's are enabled, then the .php extension is lost. So it seems to me that it's getting to the extension and then ignoring the filename in the query string.
Perhaps the filename is not being sent to the browser correctly or something, I'm not sure, there is probably a way to fix this in the way Drupal is written but I wouldn't really have a clue where to start looking. If you can enable clean URL's that is probably the easiest. I know how difficult and frustrating that can be on IIS though especially IIS6. I still haven't got clean URL's on this site.
Comment #10
kars-t commentedHi
I am closing this issue to clean up the issue queue. Feel free to reopen the issue if there is new information and the problem still resides. If not please make sure you close your issues that you don't need any more.
Maybe you can get support from the local user group. Please take a look at this list at groups.drupal.org.