Code Igniter - creating folder in FTP - codeigniter

I need your help. I am trying to create folders on my FTP server through my Code Igniter web application. If the manager clicks attachments on projects a folder gets created if it doesn't exists yet and then through file upload he populates it with files.
I have achieved all this when running the code on localhost (the folders got created, and file upload worked too), however when I uploaded my app to a live site I couldn't create folders, so I googled a little and found out I should use the ftp library, because I couldn't create the folders with the relative paths I had.
However, I still cant seem to create the folder with the following code.
if($this->ftp->list_files('attachments/výkres'.$id) == FALSE)
{
$this->ftp->mkdir('attachments/'.$id);
}
I always get the error:
Unable to create the directory you have specified.

Hope this will help you :
use with full path with starting and ending slashes like this:
if($this->ftp->list_files('/public_html/your_path/attachments/yýkres'.$id.'/') == FALSE)
{
$this->ftp->mkdir('/public_html/your_path/attachments/'.$id.'/', DIR_WRITE_MODE);
}
for more : https://www.codeigniter.com/user_guide/libraries/ftp.html#CI_FTP::mkdir

Related

Link to storage folder not working on hosting

In my local project I save the images in the storage path and load normally with asset('storage/...');
Everything works smoothly. I do not have full access to the hosting to upload the project. only access via FTP, no ssh access. When the project is unpacked on the hosting, the storage link in the public folder brings all the files as a folder. I removed it and because I don't have ssh access I declared a route to execute the command.
Route::get('storage-link', function(){
Artisan::call('storage:link');
echo (Artisan::output());
});
When running the route, it even prints the message that it normally shows when the command is run in the console, saying that the link between the folders was created.
The problem is that the images do not load.
asset('/storage/cars/photo.jpg')
if I pass the folder to the public and call it without going through the link to the storage folder asset('/cars/photo.jpg') it shows it correctly.
I hope you can help me. Thanks in advance.

showmessage.jar not found 404

I'm new in Oracle Forms, i try to execute an application developped in Oracle Forms with Java Web Start, so this application need a jar file named "showmessage.jar", when i check the folder "$ORACLE_HOME/forms/java" i found the file but when i try to access to it via browser http://192.168.1.22:8888/forms/java/showmessage.jar i have an 404 error.
I tried to rename the jar file and i can access to it, i don't know why ?
If anyone had an idea about this issue, Please help me.
Thanks.
In the rwserver.conf file, you can set what folders Forms (and Reports!) has access to.
Configuring file access
This link describes the "write" access, but this is also how "read" access is configured (I haven't tried this with environment variables):
# Single Target Directory
<folderAccess>
<read>C:\oracle\forms\</read>
<write>C:\oracle\forms</write>
</folderAccess>

Laravel 4 - can't access images in public folder

I have a strange behaviour from Laravel. I just copied the website to a new hoster. Everything is working quite fine but one thing: I can't access the images in my public folder. If I try to open an image on my own with "domain.com/img/Ausfahrten/42.png i get the following error:
error image loading
The folder structure on my server looks like this:
enter image description here
What method can't laravel find and how can I resolve this? I've already checked file permissions on the server, everything's fine there.
Laravel throw that error when it cannot find the file. Try to access to another directory without Uppercase letter in its path name.

The file name you submitted already exists on the server

Most of the time I upload an image I get an error which says "The file name you submitted already exists on the server". I am using codeigniter version 2.1.0.
Please help regarding how can I fix this.
Thanks
Please enable encrypt_name, find more here
$config['encrypt_name'] = TRUE;
By this line you are telling codeigniter to create (pseudo) random filname for your file therefore your file is going to be unique (in name matter).
Furthermore you can create such a system that uploads files in folders, consider following folder structure:
/files/pictures/<date_of_upload>/<random_string>_big.jpg
/files/pictures/<date_of_upload>/<random_string>_thumb.jpg

Move working Joomla 2.5 site from subdomain to root now 500 errors at logout

I created a Working Joomla 2.5 website in a sub domain. When I moved the site to the root and out of the sub domain folder I get the following error when I log out. Fatal error: Call to a member function init() on a non-object in /directory/templates/rt_clarion/error.php on line 20
The build works fine in the sub domain but not in the root. I've tried the stock Joomla Templates and I still get an error at logout. I tried disabling the Joomla SEF, nothing. Anyone have any ideas what might be?
The site was moved by using akeeba backup and restoring it in the root directory.
I'm using Joomla 2.5.4, K2 v2.5.7, Rockettheme Template Clarion v1.2. Again the build works flawlessly in the subdomain.
First step find out what is causing the server to throw a 500 error - check your servers log file. It may be a simple as a permissions problem, eg. most servers are configure to throw a 500 error if the destination has permissions of 777.
After moving a Joomla! installation from a sub-domain you may need to update the Global Configuration - you can either do this through the Admin screens or by directly editing configuration.php. This often happens when people create the Joomla! site in a sub-directory and the move the site and delete the sub-directory.
The things you need to check are the paths to things like log & tmp directories, e.g.
public $log_path = '/host/public_html/asite/sub-directory/logs';
public $tmp_path = '/host/public_html/asite/sub-directory/tmp';
May need to be changed to:
public $log_path = '/host/public_html/asite/logs';
public $tmp_path = '/host/public_html/asite/tmp';
I'd suggest renaming the template directory and reinstalling that template since that is where the error is occurring, unless you're comfortable exploring the configuration/options for re_clarion
1) Switch to the default template: If you still have errors, the problem is coming from new installation. If not, it's your template (go step 2).
2) Backup your Clarion template folder on your HDD and uninstall it from your backend.
3) Install it again and check for errors. If everythings is OK, overwrite your Clarion folder with backuped data.

Resources