How to path folder outside of projek folder in php controller? - php

-- Images
-- Project Folder assign in url web (ex : abc.com)
Try to access path file in Images like "/../Images/ABC.png" but the url in web becomes abc.com/Images not assign folder images outside project folder.
So, can someone help how to access the folder images outside?

Just create a folder in codeigniter root directory.
An example: I created a folder called "assets" inside codeigniter & upload a image in this folder. Image name is photo.jpg.
Now you can use in view. So base_url automatically replace with your website url.
Note: Must enter your website base_url in app.php

Related

change wordpress image upload to another directory in public_html

I want to set my wordpress files to upload to /home/public_html/images instead of /wp_content/uploads, I have gotten to the point that it gives me the correct url for /home/public_html/images but I have to move the new files from /wp_content/uploads to /home/public_html/images for it to work
I have tried changing the upload path in wp-options.php but that just makes a subdirectory in my sites folder called public_html and puts the image there instead of actually putting it in /home/public_html/images
Try going to the wp_config.php file and adding this line of code:
define('UPLOADS', 'images');
This should put the images in a folder under /public_html instead of the typical /wp_content folder.
https://developer.wordpress.org/apis/wp-config-php/#moving-uploads-folder

Accessing css, js and image in root folder laravel

Please Help.
I want to access css,js and images in root folder laravel.
in the root folder laravel i have folder themes.
for view not problem but when i'm accessing css,js and images. not working.
when i clicked link css. i'm getting not found
Hierarchy for themes
the asset() helper will look for the required path at the public dir
your themes path should be something like that
project-path/public/themes/..

How to change media upload /storage files in an outside directory like C:\media in laravel?

I created a direcrory outside my OctoberCMS project for media storage i changed the configuration of my local driver in filesystems.php and also cms.storage in cms.php it uploads the images in the folder but idon't get the real URL when i click on image URL in the backoffice.
change it in bootstrap/app.php:
$app->useStoragePath($yourPath);

image uploads in ckfinder but not showing in ckeditor

As i upload using ckfinder the file/image uploads in the defined folder,
but it return a url to ckeditor, using the url the image is not loading in ckeditor, i dont know why, am working in the localhost,
my config is as follows-
baseUrl = "/var/www/html/WC/joseph/plugins/ckfinder/userfiles/"
the ckfinder returns the same url to ckeditor, but it doesnt loads image with http://localhost the image loads,
but i cant able to change the config as locahost, when i change it then the upload doesn't works, anyone plzz help me
The baseUrl option, like you can guess from the name, is used to define a base URL. It looks like you have passed to it a path of the physical directory on your server, which is incorrect. Instead, you should put there the URL which points to userfiles folder location.
Basing on directory path from your question let's assume that your website is available under https://example.com domain, and the root folder for this domain is served from /var/www/html/WC/ directory. In this case you should define baseUrl as follows:
baseUrl = "https://example.com/joseph/plugins/ckfinder/userfiles/"
CKFinder will know how to build URL-s for files which should resolve the issue.

Upload a file to public_html folder

I have a joomla component that fetches the audio songs from the music folder on the server and plays them in the front end. And the users can upload their songs from the front end.
But the problem is that, the component settings are such that the music folder path must be outside of the web root.
The path looks like:
/home/username/public_html/audio
But i am confused how to upload the files to a location inside 'public_html' folder, using php. What should be the destination address that i can use in my code?
To get the server path in the Joomla environment:
echo JPATH_SITE;
Examples of usage

Categories