Asked 4 years, 6 months ago. Active 1 year ago. Viewed 17k times. Improve this question. Suraj Suraj 1 1 gold badge 7 7 silver badges 22 22 bronze badges.
Refer github repository for custom form with file upload. Add a comment. Active Oldest Votes. Improve this answer.
Cameron 2 2 silver badges 9 9 bronze badges. Hi, thank you for your suggestion. But here, how can I prevent entry of duplicate files in the public folder. Because of this reason I opted for "file" type.
The temporary file is deleted automatically, I think by default within 6 hours. If you don't want to wait you can delete it after you've saved the permanent file. I am not telling about temporary file buddy. You could check for an existing file with the same name before you make the temporary file permanent. CamelCode CamelCode 6 6 silver badges 21 21 bronze badges.
Would love to know reason for downvote. The main problem we face when submitting the form is that the file will be considered temporary by Drupal.
This means that although the file is uploaded correctly and will be available, after few hours Drupal will delete the file during routine cleanup tasks, leaving the functionality that uses that file in an inconsistent state. To solve the problem, in the submit form we upload the file and through the setPermanent function we indicate to Drupal that the file should be kept. In the submit of the form we check the value of that field getting the fid of the file. Viewed 23k times.
How do I pass the file data between the various steps? Improve this question. Nick Heiner. Nick Heiner Nick Heiner k gold badges silver badges bronze badges. Add a comment. Active Oldest Votes. Improve this answer. BenMorel However, once the file is uploaded, how do you save it, and use it in future functions?
Can you be a bit more precise. Rendering an image, video or txt file will require very different approaches. What are you trying to do, that can't be done with CCK's file field? Sign up or log in Sign up using Google. Sign up using Facebook.
0コメント