Upload files from google drive to server in Ionic application - angularjs

I'm new to Angular and Ionic. I'm trying to create a page where a user can upload the file from google drive to the server. He has to do it by logging into Google drive then choose the file from google drive and upload into the server. I don't have any idea of how to start and where to start. If you can guide me or give me an example, it would be helpful.
Thank you.

If you are just starting, I would recommend to start reading first about the documents regarding the Drive API and Ionic Development/ AngularJS. This would help you understand how Drive API works and what are the available functions on the API you use (REST, iOS, Android). These document can help you understand the flow and some code samples that will explain how the function will work. You can also find handling of errors, best practices and performance tips to help you improve your app.
Here are some github repo that can help you with the implementation:
Ionic
AngularJS
Hope this helps.

Related

Ionic v1 build issue

Hope everything is fine.
I have an old ionic v1 project.
The project was using sms features.
however after google update:
I received
Issue: Violation of the Permissions policy
We only allow apps to access Call Log or SMS data for permitted uses and only to enable the app’s core functionality
Google has removed my app.
I need to rebuild it again after fixing the issue.
Now we have ionic v 4.1.0.
My project structure is missed up.
The earlier developer, was using cord-ova, ionic,phone gap... etc
Any suggestions ?
I was finding myself in a similar situation. The best and fastest way in this case would be to start a new project while you have the other one open and try to copy as much code as you can. I hope that helps, good luck!

Piwik (Matomo) installation in an AngularJS app

I have to install Piwik (now Matomo) analytics tool in an AngularJS project. I am using windows and I have to do it in my local environment. I am an absolute noob in this backend stuff So, cannot figure out how to proceed.
The brief idea that I have got till now is that I'll have to use node.js with express.js to setup the local server. Also, I have to use mySQL along with it to store the data.
So, my question is that how can I do the same? Any relevant resources will be really helpful.

React Native Upload to YouTube

I am trying to upload a video that I take locally using react native camera and then send it to youtube for processing and then want to display that video on a react.js web dashboard.
We have tried using fetch-blob to upload the video and cloud firestore to store the video. We are not sure at a high level on how to go about the uploading to youtube. I know there is upload docs, however can we physically go about uploading straight from our react-native project to youtube, or would we have to upload to a database such as firebase and then use a cloud function to send it to youtube? Has anyone attempted this? The other alternative is that we can upload to S3 and then use AWS cloudstream to play back but that seems like overkill if there is a simple youtube upload that we can use. Do we have to authenticate a user to youtube before it would work? We do not want anyone having to log into a google account. We are hoping just to have an application created with youtube that we can upload to our channel.
Thank you!
Answer
You can absolutely upload a video to YouTube in many different ways. You mentioned a few options and I will line out how those could work for you.
Do we have to authenticate a user to youtube before it would work?
You will have to authenticate to YouTube in order to upload to a YouTube account. You could very well have one account for your app to use and when your users make videos the app could upload them directly to that account. I do highly advise against that though. Google is not very forgiving and the second someone uploads something to violate Google Policies I suspect you will be banned.
That leaves me to believe the best way here would be to use Auth0 to authenticate users and upload to their accounts. Otherwise maybe look into other options.
Possible Options
Option 1
It might be possible to upload all the videos to one YouTube account and make them all private. Then retrieve those videos and play them on your own site. Possibly something like that could work but it is probably a long shot. That could at least keep you from getting banned because of a user violating Google Policies.
Option 2
Another option would be to make one YouTube account. Save the videos to your server when the users creates them from your mobile application. Then have a waiting period for the video to post to YouTube in order for you and your team to have time to approve them.
At least this way you can use YouTube and have one account, but not take the chance of any repercussions from the videos people are posting.
Problem
How to upload a video from your mobile app using React Native to youtube.com
Solution 1
Upload straight from React Native. You can Use the Google APIs to upload directly to youtube. Google has an extensive API. You will have to create a Google API account and make sure to activate the APIs you want to use. Here is some information I found using the Google Javascript API to work with Youtube.
If you go to this link you can see some information on the scopes of this API.
Here is one scope mentioned on that page.
https://www.googleapis.com/auth/youtube.upload
Using Gogoles APIs you can upload videos directly to the youtube account.
Solution 2
The second solution is to post the video to your server, then once it hits the server use some other server side language to interact with Google's API. This could come in handy for other reasons. Like if you are better with a language other than JavaScript. For example Python might be your favorite language. In that case here is a Python Github repo that does just what your trying to do.
You could very well implement the repo mentioned above to your server and post the video you create from your phone to the server. Allowing the Python script to handle posting the video to YouTube.
Side Note
I do not think Firebase or really any database is necessary for the task you are trying to accomplish. Unless there are other requirements to your problem you have not mentioned.

Ionic + ng-Cordova file transfer with Django

I am developing an Ionic hybrid app and one of the features is taking/choosing a picture and uploading it to the server. I found plenty of examples of how to use $cordovaFileTransfer plugin. The problem is that my backend is in Django and I don't really understand how to process the upload request from the cordova plugin.
Any help or a small example would be appreciated. Thank you.
$cordovaFileTransfer is only the Ionic wrapper for the cordova file transfer plugin. The documentation says:
The FileTransfer object provides a way to upload files using an HTTP multi-part POST or PUT request, and to download files as well.
Since these are simple http POST requests, you don't need nothing special but only the Django file uploads documentation that contains a well documented example.

Can you import Selenium Web driver into the Google App Engin

I am sort of new to app development, so this may sound like a stupid question. The company I am working with is trying to get ride of most of there IT infrastructure, so that they don't need any more servers. I have been asked to develop a program that takes information from a google spreadsheet and then with this information puts it into a web browser. I am Planning on using Phyton and selenium web driver. Will I be able to install selenium if i host the application as a Google app engine?
The Reason I want/need to use selenium web driver is because I need to put the information from google into a legacy system. The only way to put information in the system is to mimic a user putting the information in manual in a web browser.
Thank you,
Kai
I don't understand what you think Selenium will be doing here. It seems a very strange way to want to get information from one Google property into another.
Google spreadsheets have a perfectly good API that allows you to read the data from your app and display it to users.
Edit after question update Well, now I don't see what you need GAE for. That is for hosting and running websites, and you only seem to want to enter data into an existing website. That's not what it does at all.

Resources