Hi,
I am far from the worlds greatest programmer so not at all sure how to do this..
I want to create a page that will allow particular roles to simply upload a .pdf file to a configured directory on the server.. I have content_access installed so access control shouldn't be a problem..
What I am not sure how to do is create the field on the page for the upload and tell it where to save the file..
I have the plupload module loaded for use with the media module to create a gallery.. So since this is there already the ultimate would be to use this in a page but have the uploaded files go where I want them rather than the default Drupal files directory.. If this is quite complicated though I would be happy with a simple field that I can choose a file and hit upload..
I don't really need a content type for this because I only need the one page so really just looking for a way to put code directly into a page without breaking something badly.. :)
Code examples most appreciated.. :)
TIA
I would look in to the filepath module. Not sure if this would help or not, but it will allow you to change the default path where files are saved.
Follow me on: Twitter: http://twitter.com/1rubytweets Facebook: http://www.facebook.com/profile.php?id=1058306793 Join me on: Yahoo: jruby6767 Msn: jruby@charter.net
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Wipe_Out Sent: Wednesday, October 05, 2011 4:25 AM To: support@drupal.org Subject: [support] A file upload page on my site..
Hi,
I am far from the worlds greatest programmer so not at all sure how to do this..
I want to create a page that will allow particular roles to simply upload a .pdf file to a configured directory on the server.. I have content_access installed so access control shouldn't be a problem..
What I am not sure how to do is create the field on the page for the upload and tell it where to save the file..
I have the plupload module loaded for use with the media module to create a gallery.. So since this is there already the ultimate would be to use this in a page but have the uploaded files go where I want them rather than the default Drupal files directory.. If this is quite complicated though I would be happy with a simple field that I can choose a file and hit upload..
I don't really need a content type for this because I only need the one page so really just looking for a way to put code directly into a page without breaking something badly.. :)
Code examples most appreciated.. :)
TIA
I had a customer who did something I thought a bit strange, but perhaps it makes sense for you. You apparently also have the FileField module.
This customer had a content type (I know you said you didn't want one, but bear with me) that was only for doing uploads. They would use this type, which specified a directory, to upload a few files (or even one), and copy the files path as it gets displayed, wherever they needed the actual file included. That content type was never displayed anywhere, it was only for uploads so they could know the path.
With this technique, they don't need any fancy access control because the system already gives them role-based access to create, etc. They didn't need any other special directory control or settings, because that's built into FileField. And they certainly didn't need the dreaded FTP access. And with a nicely worded title, they could easily find it again if they needed to refresh their mind about what the file path was. And it prevented them from uploading the same file every time they needed to use it.
As I said, I thought it a bit silly when I encountered it, but thinking about your request, it seems that it really was a pretty good solution to their needs. And maybe yours.
Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
From: Wipe_Out
I want to create a page that will allow particular roles to simply upload a .pdf file to a configured directory on the server.. I have content_access installed so access control shouldn't be a problem..
What I am not sure how to do is create the field on the page for the upload and tell it where to save the file..
I have the plupload module loaded
On 10/5/2011 5:25 AM, Wipe_Out wrote:
I want to create a page that will allow particular roles to simply upload a .pdf file to a configured directory on the server.. I have content_access installed so access control shouldn't be a problem..
What I am not sure how to do is create the field on the page for the upload and tell it where to save the file..
<snip> Code examples most appreciated.. :)
The examples module/project has all the code you need, particularly in the file_example and form_example modules. Are you on d7 or d6?
Ted
IMHO, the most simple and easiest way to do this is to use a content type with 1 file upload field. You can specify in the CCK field settings which directory the file will go. You can even use http://drupal.org/project/auto_nodetitle to remove the need to add a node title. Then you give those roles permission to create a node of that type.
Setup time: approximately 5 minutes.
Michelle
On 10/5/2011 2:25 AM, Wipe_Out wrote:
Hi,
I am far from the worlds greatest programmer so not at all sure how to do this..
I want to create a page that will allow particular roles to simply upload a .pdf file to a configured directory on the server.. I have content_access installed so access control shouldn't be a problem..
What I am not sure how to do is create the field on the page for the upload and tell it where to save the file..
I have the plupload module loaded for use with the media module to create a gallery.. So since this is there already the ultimate would be to use this in a page but have the uploaded files go where I want them rather than the default Drupal files directory.. If this is quite complicated though I would be happy with a simple field that I can choose a file and hit upload..
I don't really need a content type for this because I only need the one page so really just looking for a way to put code directly into a page without breaking something badly.. :)
Code examples most appreciated.. :)
TIA
Hi All,
Thanks for the input..
Ted, I am on D7.. Where would I find the examples you mentioned?
Nancy and Michelle, I will have a look and see if I can get it to work how I have it envisaged.. I never saw a content type as the solution but perhaps it can work..
On 10/5/2011 2:23 PM, Wipe_Out wrote:
Ted, I am on D7.. Where would I find the examples you mentioned?
http://drupal.org/project/examples - or - drush dl examples
I have managed to create a great form using the "webform" module so no only is the file uploading but the I can gather some data as the same time..
Thanks again for everyone's help..