Transfer files between google-drive and one drive - javascript

I have more than 10TB of content in my google shared drive I want to copy all that content in my onedrive account. I tried mover.io but it's not working for me. What should I do. Also tried google colab but I couldn't find great code of python
It's been 2nd day and I couldn't find anything that works properly and fast.
I don't want to use any 3rd-party mover like multi-cloud ...

Create a temporary RDP through GitHub action, in that RDP you will get a high-speed internet connection, download the file in it, and upload it to onedrive.
you can also use rabb.it

Related

How to edit pdf stored in a server by a webapp client?

The use case of this problem is very simple but i struggle to find a good solution for it.
I want to allow my users (through a webapp) fill some pdf files stored in server (pdf with forms, which begin more and more popular).
Actually, app like chrome or acrobat reader are able to fill them perfectly whe its open locally.
I already allow this functionnality for docx and xlsx files, for that i use Webdav and the custom protocols ms-word ad ms-excel. It works perfectly.
For pdf, I didnt found equivalent. Its look the mains pdf reader/editor doesn't implement this protocol. Whe we open distant file with these tools, they failed for write permission when save or they try to save the file locally) .
Another option i take a look was the new file system access api (https://web.dev/file-system-access/). But again i wasn't able to make it working properly. The main problem here is how we can edit the file.? Im able with this api to dowload the file locally and keep the filehandler to retrieve the updates, but i blocked on how i can edit the file ? like an option on the fileHandler to say "Open this file with default editor on the OS". this would be perfect. But for now to edit the file i have to manually open it on the eplorer. i can't ask my end user to do that there is too many risk they edit the wrong file.
Another option on the table is the different javascript library for editing PDF, but these last one looks all very expensive, usually very heavy on the client side, with advanced features definitively i don't need. I just want to fill the forms and retrieve the pdf completed. So i would like to avoid this option.
Last option i take a look, i already use pdf.js (from mozilla) and pdf-lib.js in my app for some drawing features. I was thinking
rendering the pdf with pdf.js
retrieve all the forms fields (id, type, size, position) of the pdf with pdf-lib
generate html input write on the top of the pdf with the informations given by pdf-lib
i let the users fill the input and click on a save button whe he finished
on the save, i edit my pdf with pdf lib, i set the value of all my forms fields by taking value of the corresponding html input, and i retrieved the pdf updated.
This solution look for me the more "feasible". But im afraid of the volume of development, on how it will render, deal with zoom, rotation, etc. i would like to not have my custom solution.
I precise my webapp target chrome so it make me crazy to not be able to use the chrome pdf viewer/editor to do what i want.
PS : i struggle to post this question on stackoverflow. the previous one was deleted witout i had precise reasons. i try to be more specific on this one, but please if its such a dumb question, please answer it
I feel your pain, this is currently not possible. Adobe acrobat can open PDFs from webdav locations (simply call acrobat.exe and pass in the WebDAV UNC and it will work) but there is no way to trigger this from the browser.
If you are able to deploy software to your customers machines, you could create a custom URL scheme to do this...

Google Drive file simultaneous modification

I am trying to make a simple "sync" functionality. Let me describe my problem with a simple example:
Let's say there is a file named lorem.txt on Google Drive (appFolder). What happens if at the same time, two different devices (belonging to the same user with the same Google account) access the file and try to read or change the contents or name of the file? Lets say device A is suppose to make a change in the contents while device B is also trying to do the same at the same time. The file is accessed through it's unique ID.
How to go around this problem? Is there a build in functionality or measures in place to avoid simultaneous write access to a file (like some sort of file lock)?
I am specifically looking for a solution using Google JS SDK or using plain JS (with Authentication tokens ofc). Does the Drive server returns some sort of error status code (like 404) when such a scenario happens?
UPDATE:
Based on these previously asked questions (asked in 2017 and 2012 respectively):
Android Drive Api Lock File while in use
and
Can I set a lock on files with google api?
, I think it is fair to assume that there is no such functionality built-in into Google Drive.
I will leave this question as a reference for others.

Control a PPTX file with Javascript offline

This is an odd use-case and I've tried to steer the users away from this, but I have a request to load locally stored PPT files in an HTML environment.
The idea is to view the PPT in an iframe so that I can "decorate" all around it. Users will be creating playlists, of sorts, so I need to add "next" and "previous" presnetation buttons, etc.
I have an online version of this working using the Office webapp link that many other posts have shared, but there is a concern for poor connectivity so they want it to be available offline.
My instinct was to shape this up as a PWA. I can make them use Chrome, so I have the FileSystem API "caching" the PPT files from the online source. However, I have no way to render the saved files!
Because it's offline, I can't use googledocs or continue to MS web office.
I don't know the AppCache feature well enough, but wondered if I can preload all of the docs in an iframe, will it cache those. My thought is that it won't, because the content is on microsoft (or Google's) site.
All users will have a legal copy of PPT on the computer, if that helps at all.
So far I have tried storing the files using the filesystem API in combination with the Chrome offline viewer extension and alternatively the Native Docs extension. The Chrome one will allow me to open a doc, but directly in edit mode. I need to simulate the behavior of a ppsx file, but neither extension works with ppsx files and I don't see documentation for an API that will allow me to "auto-play" the presentations.
Thanks for any ideas!
Wayne

Download image, then save locally and access: Chrome extension

I am working on a chrome extension which acts as the new tab page for a user. A number of users have asked for the ability to use their own, locally saved pictures as a background image. However, I have not been able to find a way to do this.
I am aware that there are many questions on StackOverflow with the same title as mine, but none address my specific needs:
I need to download an image from a URL (i.e. a temporary Dropbox or Google Drive URL), or use an image from an HTML5 filepicker, as in this demo.
The image then needs to be saved locally, preferably to the extension directory, and be accessed by the extension every time it loads
I do not have access to PHP or to a server on which I could call a script or host images
The other answers suggest I use the Chrome FileSystem API. However, I understand that this API is only available to Chrome apps or on Chrome OS, not to extensions.
I also found an answer that mentions the file permission in the extension's manifest file.
"permissions": [
"file://*/*"
]
I would not be against using such a permission, even though "The user has to manually approve this permission by visiting chrome://extensions/ and put a tick at the "Allow access to file URLs" checkbox," as stated on this StackOverflow answer.
However, I would not know where to start with implementing this. Your help is very much appreciated!
** I am using jQuery in my extension, so that is an option, although I would prefer to use pure JS.
*** The extension is CleanStart for Chrome, in case that is important.
Just an idea:
Maybe I could use chrome.storage to save a hex string representing the image, and then retrieve that string and convert it back to an image, as in this StackOverflow answer.

how to embed a live excel spreadsheet in html

hi i would like to know how i can embed a excel spreadsheet in a web page and change the excel numbers on the hosted file and this in turn automatically changes the webpage sheet?
would like to know if there is a jquery, javascript, css etc code to help me out
for example, book1.xls will be uploaded to the server and index.html will reflect book1.xls as a table in it. when i update book1.xls, it should automatically show in index.html the changed cells.
thanks in advance
The simple way to actually connect to an XLS is through VBScript, but your server will have to support it (which most do).
Another way would be add an ODBC to your servers connectors pointing to your XLS or MDB or whatever Microsoft data file you choose and use JavaScript or any number of languages to connect to it, retrieve data, make changes, etc. The downside is that you must have Administrative rights to the computer hosting the file. You can use a homecomputer to use as server for that file only for instance and link it to your website, but it will affect loading speeds. This will however require you to take a closer look at your home internet security...!!!...but will enable you to make 'live' changes without going to your website. This method is often used for webshops and online catalogues, places where data can change on a daily basis but a database server is undesirable.
The simplest and easiest way is as mentioned before the use of GoogleDocs, but that will require conversion of the document. You won't be using your XLS as datafile. The downside here is that if you make any changes offline (not through the website) the changes will also not be visible, because you'll be editing a completely different file. So you'll need to convert and upload it to GoogleDocs each and every time.
As you can see the method used greatly depends on how often you plan on updating the data, how much traffic you expect and how secure you want it to be.
A "live" spreadsheet can be shown in a web page via an iframe containing a Google Doc spreadsheet. You cut 'n paste the iframe markup from Google Docs and drop it into your web page. The spreadsheet is editable in GDocs. The iframe view can be set to automatically update when the ss is edited.
Perhaps, this is too bland a solution. But it works. I use it all the time.
I doubt you can do that directly from an .xls file, but if you save your Excel file as .csv, you can read a .csv file via jQuery.
There's a plugin here that displays data from a csv file as a table: http://plugins.jquery.com/project/csv2table
The same/similar question is also asked in these posts:
Read Excel data with JQuery
How to parse an excel file in JavaScript?

Categories