there's nothing built in yet that supports that feature. However there are several ways to tell swfupload where to put uploaded files. One of these is using hook_swfupload(). In README.txt you'll find more about this.
How would you get the nid if you're creating a new node? The node's id will only be available after submitting the form. Then the files are already uploaded. Hook_nodeapi however can be used to renam, copy or move the uploaded file.
The user object is already available in hook_swfupload.
You're right about the nodeapi.
I was just thinking of moving the files to the proper directory only after node is saved, so to have every token you need to build the path.
Maybe it can be done by the module itself, but I don't actually know if it's viable.
I also want to place the files into a directory related with the title of the node. If the title is: example, I want the files in example/ folder...
I have no knowledge about API... Is there an easy way to achieve this like token? Or at least can you tell me in which file will i write the code about hook_swfupload() function?
unfortunately it does not play with swfupload. just tested if it would work.
with swfupload disabled, files are moved after/while submitting a new node to the configured file path (i.e. [type]/[nid]-[title] )
with swfupload enabled, files are not moved anymore.
what about using the functions of uploadpath? swfupload would not have to care about the final path.
I'm building a music site and I need to let user upload big files.. This is THE ONLY module that let me do this, obviusly every file uploaded should go on the user directory..
Think to implement Token on filepath and this became the best way to upload every file on our sites
Have you been able to find anything out yet. I too and using the SWFupload module to do nearly the samething. I got it to upload more mass files but they don't upload in the signed on user's directory. Took me a coulpe of days to figure out why the Multiple file upload button was disabled.... I'm only about 3 weeks old with Drupal and learning alot....
Comments
Comment #1
skilip commentedthere's nothing built in yet that supports that feature. However there are several ways to tell swfupload where to put uploaded files. One of these is using hook_swfupload(). In README.txt you'll find more about this.
Comment #2
bob_hirnlego commentedI second this, or a way to build path out of $node properties.
Comment #3
skilip commentedWhat node properties are you thinking of?
Comment #4
bob_hirnlego commentedI believe that nid and title should be a good start...
In my project I need that all files uploaded with the node are stored in the following directory (using tokens here):
sites/all/files/[user-name]/[nid]Maybe I'm missing something, but I don't think I can achieve this through hook_swfupload().
Comment #5
skilip commentedHow would you get the nid if you're creating a new node? The node's id will only be available after submitting the form. Then the files are already uploaded. Hook_nodeapi however can be used to renam, copy or move the uploaded file.
The user object is already available in hook_swfupload.
Comment #6
bob_hirnlego commentedYou're right about the nodeapi.
I was just thinking of moving the files to the proper directory only after node is saved, so to have every token you need to build the path.
Maybe it can be done by the module itself, but I don't actually know if it's viable.
Comment #7
Sinan Erdem commentedHi,
I also want to place the files into a directory related with the title of the node. If the title is: example, I want the files in example/ folder...
I have no knowledge about API... Is there an easy way to achieve this like token? Or at least can you tell me in which file will i write the code about hook_swfupload() function?
Thanks,
Sinan
Comment #8
maulwuff commentedthere is already a module which does what we want using tokens:
http://drupal.org/project/uploadpath
unfortunately it does not play with swfupload. just tested if it would work.
with swfupload disabled, files are moved after/while submitting a new node to the configured file path (i.e. [type]/[nid]-[title] )
with swfupload enabled, files are not moved anymore.
what about using the functions of uploadpath? swfupload would not have to care about the final path.
Comment #9
Mindexperiment commentedI also need this feature..
I'm building a music site and I need to let user upload big files.. This is THE ONLY module that let me do this, obviusly every file uploaded should go on the user directory..
Think to implement Token on filepath and this became the best way to upload every file on our sites
Thank Andy
Comment #10
martinwillb commentedHave you been able to find anything out yet. I too and using the SWFupload module to do nearly the samething. I got it to upload more mass files but they don't upload in the signed on user's directory. Took me a coulpe of days to figure out why the Multiple file upload button was disabled.... I'm only about 3 weeks old with Drupal and learning alot....
MWB
Comment #11
smalek commentedHi, maybe this solution http://drupal.org/node/716328
Comment #12
ManyNancy commentedSolutions are here:
#716328: Add support for FileField Paths