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.061 seconds

WOW.. WOW... WOW... This is awesome... in less than 3 hours of work I have my application done... this is simply the best tool I ever tried to generate Joomla Components... Thank you very much for this tool and your answer.. it helped me a lot... My friends here in Brazil are going nuts with this...
Griiettner (Forum)

Get Started