Consider a url with a path like /drupal/files/newfile.jpg for a just-uploaded attachment that is not yet saved.
If I understand correctly, URL rewriting should make this into index.php?q=files/newfile.jpg and then upload_file_download will handle the request, making the attachment url work even though it isn't put into the files dir yet.
However, the SA_2006_006 patch added RewriteEngine off into files/.htaccess so now I just get 404 for drupal/files/newfile.jpg but index.php?q=files/newfile.jpg still works.

4.7.2 on PHP 4.4.2-1 / debian, mysql 5.0.15, apache 2.0.55

Comments

magico’s picture

Category: bug » support

Anyone else with this problem?

pwolanin’s picture

I just tried uploading a jpg file (on a linux shared host) - works fine with the .htacces file in the files directory.

Did you have the problem on the initial upload, or when editing the node with uploaded files already attached?

pwolanin’s picture

forgot to mention, however, that this is with Apache 1.3.37, not 2.0

mindless’s picture

pwolanin, this is regarding attachment preview.. click "Browse" and pick a file click the button to upload it. Then click "preview" button at the bottom. In the preview you should see a table with your uploaded attachment. Click the link here.. this link is supposed to work even though the file hasn't actually been placed in your drupal "files" directory yet (it is in a temporary location until you actually submit the node).
Once the attachment is in the "files" dir, no URL rewriting is needed. It is only the preview case where "RewriteEnginge off" causes this problem.

magico’s picture

Category: support » bug

Seems to have enough information to deserve a bug confirmation

cog.rusty’s picture

I think this has been fixed long ago in 4.7.4. There is no "RewriteEngine Off" now. Only "Options None" followed by "Options +FollowSymLinks".

http://cvs.drupal.org/viewcvs/drupal/drupal/includes/file.inc?r1=1.74.2....

mindless’s picture

yup, and the comment for that change is "Patch #86314 by dopry: made previews work", sounds like it was directly targeted at the same thing I reported here.

magico’s picture

Version: 4.7.2 » 4.7.4
Status: Active » Fixed

According to prior comments

Anonymous’s picture

Status: Fixed » Closed (fixed)