It's like this:

- User goes to create a new node.
- Uses FileField to upload a file. Presses "upload"
- File is uploaded to directory -- check
- Entry is written to files table -- check
- User clicks on the hyperlink that is generated automatically, gets a "page not found"
- reason: the entry in the files table has a "status" code of 0, because the node has not yet been saved. Therefore, the file cannot be accessed.

Any good solutions for fixing this or disabling the ability to "preview" your upload before hitting save.

Thanks

CommentFileSizeAuthor
#2 filefield_temp_file_access.patch1.57 KBquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

- reason: the entry in the files table has a "status" code of 0, because the node has not yet been saved. Therefore, the file cannot be accessed.

FileField should grant unrestricted access to any file that has a status of 0, because it's not yet associated with a node (so it doesn't know what restrictions to put in place). At least that's what it's intended to do, we've had reports of people complaining about this behavior in other issues, which would indicate this is still the case for some users.

quicksketch’s picture

Status: Active » Fixed
FileSize
1.57 KB

After testing this out, it seems I was mistaken. FileField *should* grant unrestricted access to temporary files but it doesn't. I've applied this patch which makes a list of temporary files that are acceptable to grant access to based on the user editing the node. As soon as the node is saved, access is granted normally based on the existing permissions.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.