I know there are multiple issues with files paths but I'm not sure in wich one I should have posted this so I prefer to create a new one...
I have tried many things but fupload does not place the files that I upload in the correct directory. Sometimes I see my pictures (but they are not in the one they should be) and sometimes the links are simply broken.
I have tried public and private filesystem, with or without token, rc2 and dev... but I don't remember all that I have done so I will just explain my last problem (so selfish!). And of course I have always done the uninstall / update.php / flush cache / remove field - create field /create and delete content.. (this is not in the correct order..)
So for now my configuration is:
filesystem is private, fupload module is rc2, CCk 2.4, filefield 3.0, imagefield 3.0, imagecache 6.x-2.0-beta9, token 1.12.
The filesystem path are /home/myname/drupal_uploads/files or tmp (outside the 'web directory' wich is /home/myname/public_html/) - (directory rights are 700 for files/tmp and 755 for the contained folders)
Image field and image cache work and put the files in the correct directories (with or without token).
The problem:
When I use an fupload field with a simple path (ie photos) I see my pictures when I upload them and when I open the nodes.
But the files are put directly in my 'files' folder (not files/photos/) and the files in the tmp directory remains there.
When I use a path whith token (photos/[user]/[site-date-yyyy]) the path are broken:
http://www.mydomain.com/system/files/imagecache/presetName/%252Fhome/myname/drupal_uploads/tmp/pap03_0.jpg and not what they should be: http://www.mydomain.com/system/files/imagecache/presetName/photos/admin/2009/pap03.jpg
The files remains in my tmp directory and they are duplicated within this directory (original_filename.jpg and original_filename_0.jpg) and nothing is to be found in the 'files' one...
So that's it! (yeah I know that was quite boring to read, sorry!)
Thanks you!
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | image_fupload-HEAD_498514_create_path2.patch | 895 bytes | dboulet |
| #25 | image_fupload-HEAD_498514_create_path.patch | 875 bytes | dboulet |
Comments
Comment #1
grandcat commentedOne thing, I can say directly:
Cron will delete these one later.
Token/Filefield paths might not work correctly in some cases, I still have to do some researches. Keep tracking it.
Comment #2
tannerjfco commentedI am having similar issues on my test environment using XAMPP on Windows. I did a test upload of 20 or so images, and I'm not sure how much it's actually doing. It creates the nodes, and the image paths are there, but it adds the tmp directory to the path. It also isn't creating the images in the folder I specified for them, though the folder exists and drupal has no problems with the paths. I also noticed if I go back in and edit a node, remove the broken image and reupload, it works.
Here is the path it's generating:
Also doesn't work if I change the display of the field in CCK to use the full size image that is untouched by imagecache:
Comment #3
grandcat commentedAnother module seems to mess up the paths.
Comment #4
mathis commentedHi,
Since I am working on my website (the online server where I originaly had my pbs with fupload), and I don't have a lot of time to make some tests, I just set up a new drupal instalation on my local wamp.
The set up was straightforward: let fupload enable the required modules, setup imageMagick, make an image cache preset and set up filesystem (private). I made a first test without token and then enabled it...
So the 'pb' is the same with or without token: it does the upload and creates corrects href to the files (I mean I see the pictures) but it doesn't put the files in correct path if it doesn't already exists. If the folder exists it works correctly.
First test was with a path set up to 'photos':
- files went in 'files' folder.
Create folder files/photos and then correct upload.
Second test with 'photos/[site-date-yyyy]':
-files went to 'files/photos'
Create folder files/photos/2009 and then correct upload...
I don't know what to think about this... Maybe in this case it's just a problem of rights (not sure the way windows handles them since when I look to the folder properties there is always a square in read only even if I deselect it...) and that would mean that fupload works (yeah that's crazy! =) ).
The only way to sort this would be to make the tests on my real server I guess... I'll do that next week!
Have a nice day...
Comment #5
mcload commentedI am having similar problems. I am using Revisioning module. When I delete the revisions, the original files are deleted from sites/default/files/ folder. However, imagecache created version of images remain at sites/default/files//imagecache/storygallery . Also they remain at /tmp folder. I run cron, but they were not deleted. Record of deleted files are still at files table of the database with status 1.
Comment #6
grandcat commentedIt will take a while (a constant time) after the tmp images will be deleted.
This has nothing to do with fupload.
Comment #7
mibfire commentedI have the same problem, the files will be uploaded to files dir instead of files/somedir/sometoken(or i created new content type called test and files were saved in test dir instead of test/[title-raw]) It drives me mad!!!
Comment #8
timtrinidad commentedI can confirm the same behavior. Uploading images with image_fupload will keep files in the /tmp directory (as expected), but the stored paths seem to stay as the tmp files, and imagecache creates its images from there. The node finally stores images that are all like:
system/files/imagecache/photos_thumb/%252Ftmp/14_1_0.jpgTokens are properly processed when the filefield or regular image field rather than the image_fupload widget is selected.
Comment #9
timtrinidad commentedAdditionally, editing the node and resaving it actually has the expected behavior - the correct directories are created and the files are moved. The initial save, however, still doesn't work.
Comment #10
grandcat commentedThe actual token version might not work with FUpload.
If there's any time, I will check this. At least, this should be fixed in the complete rewrite which integrates better in CCK and, of course, in Drupal.
Comment #11
pam.pkrweb@gmail.com commentedI am having similar issue. I created a photos sub-directory under files to put all the images in. When I upload images using Fupload it puts them in the 'files' directory not my 'files/photos' directory. I set the path in the content type image field under the 'Path settings" to 'photos'. I get the following error in my reports.
The directory sites/ourfatherschurch.org/files/photos is not writable, because it does not have the correct permissions set.
Directory permissions looks like this drwxrwxr-x.
What should the permission be?
Also, I love this module great work. It is a life saver when uploading many images for photo gallery.
Comment #12
grandcat commentedIt seems that you did not set the correct owner/group for the directory "photos". They have to be equal to "files" directory's owner/group and permissions.
Comment #13
ore commentedAdding this :
after this:
so the whole function looks like this:
in the file image_upload_imagefield.module around line 574 fixes the tmp and placement problems for me.
havnt tested it with the tokens yet but i imagine it will work for those as well.
cheers
mike
Comment #14
ore commentedyup it works for tokens :D
Comment #15
grandcat commentedThank you, I will check this one.
Comment #16
rokrDoes this also work in conjunction with filefield path?
cheers, Ronald
Comment #17
vegemite4me commentedThis fixed it for me. Thank you ore. Great module grandcat.
Comment #18
rokrI have tested it in conjunction with filepath module and it still doesn't work with it.
cheers, Ronald
Comment #19
my-family commentedThe same problem (using with ImageField).
#13 code works for me (but not with Filefield path), thanks a lot.
Otherwise, the module is excellent (thanks for it), I hope that this bug will be fixed soon...
Comment #20
Olli1984 commented#13 is top! Thx!
But i need it for Filefild too, can you do anything?
lg
edit:
Sorry, Fupload and filepath upload works for me! very nice!
Comment #21
Kay200 commentedHey all,
any update on Fupload + filefield path bug?
any workaround?
Comment #22
grandcat commentedI'm sorry, don't have the time at the moment. Perhaps someone wants to provide a patch.
At least, I will fix it with the complete rewrite (FUpload will become smarter, Preview list will be replaced with Views + another module, ...).
Comment #23
marcus178 commentedI've tried the patch and it still doesn't work.
Comment #24
marcus178 commentedAlso I have found that the filepath doesn't work with imagefield but does seem to work in conjunction with the image module
Comment #25
dboulet commentedThe code from #13 works well for me, here's a patch.
Comment #26
dboulet commentedNew patch uses
file_check_directory()instead to check for the existence of the directory.Comment #27
dboulet commentedComment #28
dboulet commentedComment #29
marcus178 commentedI have applied both these patches and is doesn't seem to make any difference, the filepath is still being ignored. Have I missed something?
Comment #30
dboulet commented@marcus178, are you using the Filefield path module? The patch isn't compatible with it.
Comment #31
marcus178 commentedSorry I thought this related to Filepath
Comment #32
grandcat commentedCommitted to CVS Head. Thanks for all the help.
Comment #33
dboulet commentedThanks grandcat. For anyone looking to make this work with the Filefield Paths module, there is a separate issue for that: #409070: Image FUpload doensn't support file path tokens via Filefield Paths module.
Comment #35
smartango commentedthis do not recursively create directory: only depth 1 directory creation. In drupal 7 file_prepare_directory does that.
Comment #36
smartango commentedI had a genial idea ;)
Comment #37
unc0nnected commentedThank you so much for this patch.. Out of curiosity, 2 years after it's release why hasn't this fix made it into the module yet?
Comment #38
brunorios1 commentedthe token [date-in-tz] that creates 3 directories (d/m/y) don't work.
if i use two tokens with a slash separator doesn't work too...
only works with only one token that creates only one directory.