permission denied to access server folder using ckeditor image upload - javascript

Request you please help I hav einstalled ckeditor on core php also instaleed plugin "imagebrowser" and "imageuploader".
In config.js added
config.extraPlugins ='imageuploader';
config.extraPlugins ='imagebrowser';
config.filebrowserBrowseUrl ='/imagesNew';
config.filebrowserImageBrowseUrl ='/imagesNew';
config.filebrowserUploadUrl ='/imagesNew';
config.filebrowserImageUploadUrl ='/imagesNew';
But browse button comes and error comes Forbidden
You don't have permission to access /imagesNew/ on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Please help

Hard to read... but the error message is quite self explanatory: you have a problem with permissions. The text of error is telling you even You don't have permission to access /imagesNew/ on this server so the problem is that. The question why dont you have permissions to access that directory in server? is the one that matters but we can not know the answer to that. Probably /imagesNew is not inside webroot tree folder and you're trying to access it with a non privileged test user.
Cheers.

Related

Direct link to a file located on Google Drive

What I want to do is to create a direct link URL to a mp3 file which is located on my Google Drive and use it on Audio object of HTML5, but I get 403 error.
I know that when one tries to create a link of a file located on Google Drive, it creates not a direct URL to the file but a URL for viewing the file through a viewer such as
https://drive.google.com/file/d/<file ID>/view?usp=sharing
I googled to find it is possible to rewrite it into a direct link URL like this:
https://drive.google.com/uc?id=<file ID>
I set this URL in the src property of my audio element. However, when I try play() method, the following error is thrown:
GET https://drive.google.com/uc?id=<file ID> 403
myProject.html:1 Uncaught (in promise) DOMException: Failed to load because no supported source was found.
So I tried to access to the URL https://drive.google.com/uc?id=<file ID> from my browser.
Then, I got this:
403. That’s an error.
We're sorry, but you do not have access to this page. That’s all we know.
I tried many times so it is not likely that I'm mis-pasting the <file ID>.
What should I do to create a valid direct link URL of the file?
I would appreciate for any information.
Progress
I got what was wrong.
The problem was that a file on Google Drive can be accessed only from the user who is authorized, which means only the owner of the Google account can access the file URL.
I tried to access it from Chrome Browser which is associated with the Google account, then, the error didn't occur.
However, I want to serve this file to all the people.
What should I do to give permission for access to other people?
You understand that Google drive is not a file hosting service right? This solution is not going to be very stable even if you do get it to work.
For it to work your going to need to set the file public so that everyone can access it. Then i would be willing to bet you will need an API key to do this in the long run.
Also remember that file id is not stable it can change in the future if for example you upload the file.
I solved this on my own. I right clicked the file, clicked Get link, and changed the authorization selection from Restricted into Anyone with the link. Then, the 403 error vanished for the access from anyone.

My php script return a 403 error whene i call him

I have a little problem with PHP:
On my site, I call the PHP script with the fetch method in javascript to dynamically record log files or to list the files in a folder with the PHP blob() function.
My problem is that locally everything works fine, but once on the server, I get the following error with a 403 code:
Forbidden
You don't have permission to access this resource.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
I tried to put the rules to 777 on the files, nothing to change. I also tried to delete the .htaccess (in case a rule disturbs), but no result.
I dry a bit, and I don't know what to try :/
If you have an idea, I would like to know her!
Thanks for your time :)
EDIT :
After a lot of tests, I discovered that the same code works perfectly on another server... so it's probably the configuration of the server I need to change, but what? I don't know exactly, ^^.

cannot find js file

I have stucture code like this:
I try to load javascript into php file like this:
But i have an error like this:
This is my html :
And this is another javascript:
And i try to copy paste the link, and i got an error 404 not found. How can i fix it? Thanks.
Permissions
When the host is correct, and the file is in the right place, and you have no other networking problems, you may sometimes still get a 404 because of bad file permissions. If a server does not have permission to access a file, it may send out a 404 error in response. The reason why some "Not Authorized" error is not given instead, is that this would reveal more information about the files than you, the owner of the server, may intend. The way to respond to requests for privileged files without revealing whether or not they exist is to give a 404.
On Windows, you can view and change the permissions from the File Explorer by right-clicking on the file or folder, then going to Properties -> Security -> Edit. For more information, see the notes on permissions on Microsoft's site.
File Types
Besides permissions, a server must also be configured to serve the type of file you are accessing. If files with different extensions are served, but .js files are not, check the configuration of your server to make sure that .js files aren't blacklisted (or not whitelisted, as the case may be).
Directory Location
You should also verify that the files are actually stored in the top-most directory of the web server if that's how you are accessing them. If they aren't, you may need to prefix the path with the path from the webserver root to your application directory. E.g., instead of fusioncharts/..., you may need /path/to/fusioncharts/... or ../../path/to/fusioncharts.
Other Considerations
In your particular case, you should also verify that the files inside the fusioncharts folder are actually structured the way you think. (E.g., is there really a js/[insert name here].js file inside the fusioncharts folder?
If none of that solves your problem, try to take something that is working and gradually make it more and more similar to the files that aren't working. By figuring out at which point you go from a working setup to a not working setup, you may discover the problem.
If you are referring to a file with path: /ui/new-file.js
then,
1.In html file include
<script type="text/javascript" src="/ui/new-file.js"></script>
2.In server.js or app.js whichever you have, include
app.get('/ui/new-file.js', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'login-file.js'));
});
Assuming you are using codeigniter, you can use base_url() function to include JS files in your codeignitor view template file.
<script src="<?php echo base_url(); ?>fusioncharts/js/fusioncharts.js" type="text/javascript"></script>
codeigniter default view template is called welcome_message.php and this file is located in application/view folder.
This is how I include js files in my codeigniter projects. Hope this will help.
In the html you can write *script** in the head or in the body, but not in your file js, delete this in fusionCharts.js
<script type=text/javascript>
In fusionCharts.js write only the function without the script
If you are developing locally, try clearing your cache.
Google Chrome likes to use the cached JavaScript files instead of the real ones.
Clearing your cache should resolve the issue.

Save file Python - IOError Permission Denied

I am making a post request to a python script and then I want to save an image file to the server, in the html folder here is what I am doing
fh = open("/var/www/html/images/logo.png", "wb")
fh.write(image_data.decode('base64'))
fh.close()
but then I get this error, IOError: [Errno 13] Permission denied: I have found out that it means this file doest have permission to save the image, and I could get around it by doing chmod to 777 but that is dangerous and bad, so how else can I save the file but not let the file be edited by anyone?
Thanks
You could either change the permissions or run the script as a user with the correct permissions. I don't see many other options. You could have your script edit the permissions, write, and then change the permissions back although it would still be editable for a moment, and it just seems like a bad idea. The script could fail for some reason and leave the permissions allowing anyone to edit. Edit: If you can change the permission you should be able to write, making my last idea pointless.
It may appear a bit convoluted but I suggest that you might want to investigate the /etc/sudoers file.
For your purposes, you would create the file somewhere that you do have permissions like /tmp and then move it to /var/www/html/images/ using a script that is named as a sudoers Cmnd_Alias.
You still need to envoke the Cmnd_Alias script with sudo but if you have declared it with NOPASSWD then it should just function without asking for the sudo password.
Always access the /etc/sudoesrs file using visudo
an example of the entries in that file:
# Cmnd alias specification
Cmnd_Alias WEB = /home/test.s
and then later in the file:
# User privilege specification
root ALL=(ALL:ALL) ALL
rolf ALL=(ALL:ALL) NOPASSWD:WEB
with this, the /home/test.sh will perform whatever task the user rolf sets it, such as moving a file from /tmp to /var/www/html/images/ when the command line, sudo /home/test.sh is issued, without asking for the password.

Flash360 rotator giving Error 2032 on server

I have a flash rotators for a website i am doing for a client.
I am able to view and use them if i load them off my computer.
But as soon as i load them on to any of my servers and try to access them i am presented with an IO error 2032
Now i know this means it cant find the files it needs to load so i then changed all the links to absolutes when it was calling for the necessary files and i still get the error.
I have also checked all folder permissions and their all good.
I am at a loss to wht maybe the problem.
here is a link were i just put all the rotators up to view
http://honeyword.mybigcommerce.com/pages/Clickers
file structure
Mainfolder
Viewer
_html files (for each product)
_swfobject21.js
_expressInstall.swf
_ImageRotator.swf
_Products
__Folders(producname)
____config.xml
____Images
_____.png
any help would be appreciated.
thank you
It seems to be an error related to file or folder permissions: I get a 403 Forbidden error page when accessing the file in the error message directly (I copied the filename from the first of the error messages below the "checking..." field and just pasted it in a new browser window).

Categories

Resources