I am working on project using reactjs ,In that I want to access user's google drive and create my own folder
and upload file in it , Creating folder is not done by user ,it should be done automatically in backend ,I just ask to user for accessing google drive....
I am trying use of google drive API in reactjs but creating folder and uploading I am not getting
Can anyone help me out in this?
Thank you.....
I'm trying to learn about hosting websites on GCP, and have just finished the App Engine Quickstart, which gave me a working appspot.com domain which runs off helloworld.go.
But now I want to try a pre-made html template (contains .html, .DS_STORE, and css/fonts/images/js folders) that I have tested to be working locally.
Following the "Hosting a Static Website" tutorial, I have uploaded the html template folder into my bucket "... .appspot.com", and enabled the entire bucket to be publicly viewable/readable. Then I disabled and re-enabled the App Engine session to try and get it to reset.
However, the URL still loads the default "Hello, world" plaintext used in the Quickstart.
I may have a pretty fundamental misunderstanding of how web hosting on App Engine works. Could someone please check if what I'm trying to do is reasonable, and if so, how do I actually do it?
EDIT: I have also had success deploying other code samples included with Quickstart, but still haven't figured out how to ignore those and deploy directly from bucket.
I understand that you have a static HTML page in your Google Cloud Storage bucket and you want that app your App Engine application points to that html page.
It is possible to do that, just taking the files from the bucket and then printing the content, but if you just want a static page, the best option could be the following:
Create a bucket and upload ONLY the static template in that bucket, please, don't upload sensitive information there.
click in the three dots at the right to edit the permissions of the bucket.
give the "Storage Object Viewer" role to the member "allUsers"
enter into your bucket and click into the the public link of your index.html
The link will be something like: https://storage.googleapis.com/< YOUR_BUCKET >/index.html
EDIT
As requested by the OP, the link https://storage.googleapis.com/< YOUR_BUCKET >/index.html it's really long and not too friendly, for that reason this is a small tutorial of how to attach a custom domain to your Google Cloud Storage bucket.
Create a domain, you can use Google Domains or if you just want a free domain, you can use something like Freenom and get your domain for free.
Go to Google Search Console and follow the small tutorial, this is just to verify that your domain it is actually yours. It will ask you to upload a file into your domain. To do this it's as simple as
2.1. pointing your domain to the external IP of a Compute Engine Instance
that you own with apache installed and the file in there.
2.2. You can use the pre-made Compute Engine instance with lamp in the
Marketplace.
2.3. Just upload the file provided by Google in
/var/www/html/ inside of your new instance.
2.4. Once your verification is done, delete this Compute Engine instance to
not to waste money.
3.Create a bucket with the same name as your verified domain, that means, if your domain is "larrycai.tk", your bucket should be called "larrycai.tk". If the "2." was made correctly it will let you create that bucket, if not, it will show you an error message saying that you need to verify that you are the owner of that domain.
4.Go again to your domain provider (in my case, freenom) and in the DNS menu add this record:
as you see, you need to add a CNAME record and the target will be c.storage.googleapis.com, if it ask you to set a name, just add your domain "larrycai.tk".
5.(Optional) If you want to redirect your bucket url to a main file (like index.html for example), just run this command:
gsutil web set -m index.html gs://[your_bucket]
Now, with all theses steps, you should be able to see your static web page in your own domain.
There are different ways in deploying a site using Google Cloud Platform. The "Hosting a Static Website" tutorial refers to hosting a static website using Cloud Storage only.
To host a static website using App Engine, you will need to edit the app.yaml file of your application and create request handlers that will point to your static website.
As you are using the go qwikstart tutorial, I'm going to assume that your directory looks something like this:
helloworld
|-- app.yaml
|-- helloworld.go
|-- helloword_test.go
Create a new folder within the helloworld directory, in this example, I'm calling it www
Move your static files to the folder you just created, in my case the www folder
In the app.yaml file, add the following, replacing www with your folder name:
handlers:
- url: /
static_files: www/index.html
upload: www/index.html
- url: /(.*)
static_files: www/\1
upload: www/(.*)
Deploy your application using gcloud app deploy.
For more info, Google provided documentation on serving static content for:
Go
Python
PHP
Node.js
Java
.NET
Ruby
Trying to import a mediawiki.xml into Bitnami mediawiki instance hosted on Google Cloud.
Per Google instructions, moved the xml into the Google Cloud Storage bucket using the browser.
In that browser, I can see the file under what looks like a path - Buckets/2017-11-09-mediawiki_import/mediawiki.xml
Within the Google Cloud SSH client, I am in the Bitnami instance at the path:
me#bitnami-mediawiki-dm-8cff:/opt/bitnami/apps/mediawiki/htdocs/maintenance$ running:
php importDump.php < file name here...
I am not clear what the actual path is to the Google Buckets, or how to find my XML file through the SSH client.
Newb here - so it might be really simple, but I'm not familiar with these tools or command line, any help would be appreciated.
Accessing with the URL
If your file doesn't contain any confidential data you can make it public to everyone knowing the URL and download it.
From the Google Cloud Platform Console, select "Storage" in the menu, find your bucket and your file and then check the box of the column "Share publicly"
There is a URL for each file and folder and bucket hosted in the Google Cloud having the following format:
https://storage.googleapis.com/BUCKETNAME/FOLDER1/FOLDER2/.../FILENAME
Therefore if you have the rights to access the resource you can download the file with any browser or command line tool as curl or wget.
Using $ gsutil
Since your machine has been provided by Google Cloud Compute Engine, and Cloud SDK is already installed, you can use gsutil to access to the bucket.
To copy locally the XML file you stored you can run the following command:
$ gsutil cp gs://2017-11-09-mediawiki_import/mediawiki.xml .
If you get any error, you might need to run gcloud auth login to authenticate yourself and issue the previous command again.
Run the script
Following on of the two solutions, if you succeeded in downloading the file from the bucket, you can run the command:
php importDump.php < mediawiki.xml
Currently I am trying to develop a Music streaming service: using SoundManager2 for streaming. I am using Google App engine to do the same. Music files are stored in Google Cloud Storage Buckets.
After completion of each song I would do an ajax query to fetch the url of the next playable song.
But while doing so I expose the direct URL to the .mp3 file and I am able to download the same thorough the URL (with a little help from Chrome Developers Tool).
How can we stop the song from getting downloaded or do some thing like SoundCloud where the URL is not getting identified in Developers tool?
is there any way for a google app engine app to convert a user uploaded docx file to html?
I think the question is really; How can I convert a word document to HTML using Java/Python. and has little to do with google-app-engine itself.
This has been addressed on SO already for Python and for Java
One possible solution would be to use the Google Apps Document List API to send your file to Google Docs and then retrieve it in another format.