Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

[SOLVED] [HOW TO] direct access to uploaded files 12 Dec 2012 13:37 #6029

  • mfr75
  • mfr75's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 1
Hello,
I would like to know a method in order to have direct acces in frontend to images uploaded from backend. so that browser could cache these images for beter performance.
unfortunately when i do this in my front end views a get a 403 with a forbidden access.
any suggestion for a way of hacking it ?

thanks a lot.

Please Log in or Create an account to join the conversation.

Re: direct access to uploaded files 13 Dec 2012 07:49 #6036

  • mfr75
  • mfr75's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 1
I found the solution :
in the file administrator/components/com_yourcomp/classes/upload.php
in the line 106 :
                //Protect against execution and set writable
		@chmod($uploadPath, YOURCOMP_UPLOAD_CHMOD_FOLDER);
just comment the chmod line so that it will not change folder permission on the path where your files are.
if you have already upload files to your path before making this change.
just do a chmod 755 to your path

++
The following user(s) said Thank You: JoomGuy

Please Log in or Create an account to join the conversation.

Last edit: by mfr75.

Re: direct access to uploaded files 13 Dec 2012 08:33 #6037

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Nice! @mfr75!

I'd made a point of coming to this post today to point you at the upload class but you got there yourself first!

Thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

Re: direct access to uploaded files 13 Dec 2012 10:58 #6042

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Good.

just comment the chmod line so that it will not change folder permission on the path where your files are.
if you have already upload files to your path before making this change.
just do a chmod 755 to your path


You can also do it propertly, not commenting, but changing the chmod for something else specific : ex : 755.
Define it in constants, or create a new constant.
Coding is now a piece of cake
The following user(s) said Thank You: JoomGuy

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.086 seconds

  I found "cook" two days ago. Played around with it for a day and then within a day got rid of two legacy applications in IBM Lotus Domino Notes and replaced them with "cook". It was really easy. A piece of cake. Actually it was even easier than cooking. Cooking involves more work than developing with "cook". What can I say about "cook"? Great application great price for what it delivers great forum with a lot of information and fast responses active and friendly community fast forward moving development cycle So what should I say "Monsieur Le Cook"? Keep the good work going it will lead to success. Having become a paying member in the words of Edith Piaf may I say ..... non rien de rien ... je ne regrette rien. Vive La France.
FK (JED)
         

Get Started