Drupal 7 public private files




















Can someone provide some some advice on this? I'm assuming that your "fields" are fields on a content type, but I think this advice is helpful regardless. You'll see that there's methods for actually moving the file, too, if you need to do so. I've only scratched the surface, but the File API has been very useful. I finally got this to work. Essentially, Micheal's response first response to original question was a good guideline for beginning.

I'll add some notes here in case someone else is looking for this solution. I used this very excellent tutorial as my guide to modify the widget: Drupal7 tip: Alter a field widget by Dominique De Cooman google this. Next, you need to process the results of this form -- that is, create code which will actually do the physical switching. Of course, there are a lot of little details in between, but the gist of it is that it can be done, and Michael's outline is a great roadmap for at least one way to do it.

This also will update URLs contained in content body and summary. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Learn more. Change individual file from public to private and vice-versa Ask Question. Asked 8 years ago. Active 1 year, 2 months ago. Viewed 3k times. Active Oldest Votes. Improve this answer. Good call. I've updated my answer with your suggestion. Sign up or log in Sign up using Google.

Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Winter Bash Is the code in your question still up to date? Yes my code is up tp date other your suggested code.

I added dpm's of all my trail and errors in my question edit. Can you please have alook into it? Stefanos Petrakis — miststudent Show 2 more comments.

Try the following. Thank you for the answer, it creates the file in the private directory but while accessing it through brower it shows different path and shows access denined error while viewing it. It is showing the following URL : example. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.

The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta.

New post summary designs on greatest hits now, everywhere else eventually.



0コメント

  • 1000 / 1000