hi

i have setup drupal 4.7 for my company's website with firefox as browser. I enabled the upload module and as per the post by budda
at http://drupal.org/node/61841 I followed the method of not using the attach button at all and that seemed to upload the attachment. But when I hover over the link of the attached file when I submit it the path shown is relative to the root of the site

for eg.

Suppose the site name is http://www.examplesite.com/drupal

And drupal has been unzipeed in /var/home/drupal

if I attach a file /var/home/drupal/xyz.pdf through the method described above it is attached but on moving over the link the path shown

http://www.examplesite.com/drupal/var/home/drupal/xyz.pdf and hence due to that i get an object not found error because the correct path should be http://www.examplesite.com/drupal/xyz.pdf

how should i go about solving this ? thanks in advance

Comments

bradlis7’s picture

I think the problem is because of rewrite rules. The fix is in the .htaccess file. Look for this line:

  # Modify the RewriteBase if you are using Drupal in a subdirectory and
  # the rewrite rules are not working properly.
  #RewriteBase /drupal

You need to uncomment the RewriteBase. It should be write with the /drupal, because that's the path relative to your domain name. ( example.com/drupal )
--
Bradlis7.com | Churchofchristnet

crashpoint’s picture

hi bradlis

thanks for your reply. I carried out the above change, restarted apache and then when i reattached a file to my page. On hovering over the link of the attachment again i got the same path but the differrence now is that earlier when i did not change the rewrite rule base the error i was getting was

file attached : /var/home/drupal/files/xyz,pdf

path shown : same as earlier http://apps1.starxsoft.com/drupal where drupal was the directory in which drupal tgz was unizpped

Error in the earlier case :
-------------------
Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.
Error 404
apps1.starxsoft.com
Wed May 24 11:35:00 2006
Apache/2.0.49 (Linux/SuSE)
------------------------------

and now the error that i get is a Page Not Found in drupal error. Earlier I used to get an error which took me out of the drupal environment.

The good part is that I am still in drupal but the bad part is that still the path is the same which i was getting earlier

Do I need to make any changes to settings.php ? If you attach a file in Drupal can you tell me what is the path that you see when you hover over the link?

crashpoint’s picture

After I posted the above reply What I did is that within the drupal directory I created the entire structure within the drupal directory i.e. if my file is present in /var/home/drupal/files then i created /var/home/drupal/var/home/drupal/files and when i hovered over the attachment link it showed http://apps1.starxsoft.com/var/home/drupal/files/xyz.pdf and as the structure /var/home/drupal/files/xyz.pdf was present I could attach a file.

This does make it look dirty but it works. Can anyone suggest a way to circumvent this?

crashpoint’s picture

do i need to make changes admin -> settings -> file system settings. I could not understand that part.

crashpoint’s picture

I had to change my download settings to private and it worked properly.

Do I see a string of questions and answers to my own questions ? : )

bradlis7’s picture

Well, looks like you fixed this with your other replies, but I wouldn't do this. If you changed the download directory, it would just undo that again, and you have to go in and move the files otherwise. Looks like private downloads works best.

--
Bradlis7.com | Churchofchristnet