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.
Related
I'm working with an HTML file that sends data using AJAX through POST to https://www.example.com/register_email.
If I copy & paste https://www.example.com/register_email in my browser it returns
{"status":"error","message":"Please enter Email"}
but in FileZilla I'm not able to find anything called "register_email", same goes with my hosting's file manager.
Is the site being requested by AJAX owned by you? If not, since you have no control over the site you won't see anything called "register_email" in your server's directory.
When you past it in the browser you get an error is because
browser requests web pages using GET method
no data is being passed
Lastly if the domain (to which the request is being sent) is yours, and you still don't see anything called "registered_email" try searching using filezilla or see if there is an htaccess rule for masking the url
I have a wordpress site that we recently made live. We built it with a temporary URL and then switched it to the live url. I'm getting a soft failure for the SSL because of the theme's default logo.png. I've done better search and replace to try and change it but it can't since it's hardcoded. How and where would I change that so that it shows the live url and is secured?
Website is hobnobevents.com
Error from whynopadlock.com: https://www.whynopadlock.com/results/828a837d-e8d4-4553-8492-5b1d7e784454
An image with an insecure url of "http://185.56.86.90/~onetoncr/hobnobevents.com/wp-content/themes/bodega/img/logo.png" was loaded on line: 1 of https://www.hobnobevents.com/.
Errors that are reported on line 1 are generally not part of the source code. This error may be caused by an external javascript file which is writing to the page, however we are unable to reliably detect these scripts in our automated test.
Please contact us using the "Need Help?" link below if you need assistance with resolving this error.
This File is Present in Your JavaScript.
URL of JavaScript
https://www.hobnobevents.com/wp-content/themes/bodega/js/default.min.js?ver=5.3.2
Code is
$j([theme_root+'img/logo.png']).preload()
Check this code or change the theme_root may help you.
I have an jQuery('#Frame').animate360 script on page and it calls a file called Profile.xml to get its settings etc.
Problem is Profile.xml is on Azure Blob and is in uppercase (PROFILE.XML). This means a 404 file not found error.
I can't change filename(Profile.xml) on azure.
The piece of JS that calls the Profile.xml seems to be encrypted in a library (HTML5Loader.js) i.e. The text 'Profile.xml' does not appear in any file and can only be found with chrome debugger in an unnamed file.
My instinct was to use something like Application_BeginRequest etc to catch a 'call' to https://storageblabla.blob.core.windows.net/uploads/ALPHA/3DIMAGES/1.010659/Profile.xml
and change it to ...../PROFILE.XML
but it's to late at that stage. It already knows that its a 404.
There must be some access, with code, to a point where a remote url is being called that can be intercepted.
Rekon its a one line fix but I just can't find the right term to search on.
I am working on a project where I'd like to upload a file to a Google Drive using a URL. One property I stumbled upon was downloadUrl. I'm not sure if it's what I need yet, but in the documentation here (https://developers.google.com/drive/v2/reference/files) the column of description is blank.
What is this property used for?
This property is used to allow you to download the file. If it is present in the file info metadata you can use it to issue a HTTP GET request and download the file.
You can do it using a token granted by the domain administrator user or the file's owner user.
'downloadUrl' Allows you to download files that are stored in Google Drive. You can download Google Documents and export them in a few different formats using exportLinks .
To get downloadUrls, you need to get the metadata of a file. Do it by requesting GET method. The method will return a file resource that include 'downloadUrl' property.
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).