Ionic 2: Uploading file from google drive/cloud to my own server - ionic2

In my application I have a functionality where user can upload his resume(of format .doc,.docx,.pdf). I'm using Ionic File Choosing plugin to choose the file and to upload I'm using Ionic File Transfer plugin. It is known that the file transfer plugin expects fileName filed in FileUploadOptions which will be the name of file to be uploaded with it's extension. In my case say resume.pdf/doc/docx.
For getting the file extension I'm passing the chosen file's path to Ionic File Path plugin which will resolve it to it's native path.
The whole process is working absolutely fine when the file is chosen from mobile's native file system.
But when the file is chosen from drive/cloud application the Ionic File Path plugin throws error cannot be resolved to native path.
As I'm not able to resolve file path to it's native path I'm not getting file's extension.
When I'm not aware of file's extension it is not possible to upload the file to my server. (if I keep filename field empty in FileUploadOptions, by default name.jpg will be taken which may not be the type of file that I'm trying to upload).
Please suggest how can I get the extension of file that is chosen from drive or how can I upload a file without default filename field in FileUploadOptions.
7.It's similar to this question ionic 2 How to download file from Google Drive and I-cloud as there is no proper answer for this question I'm reposting it with further explanation.

Finally I found solution for this problem. I have created a public github gist where I have explained the solution. The link for it is as below
https://gist.github.com/coolvasanth/d042a26deda75f5e390b42b87995f30d

Related

image file cant upload to postman

I am using postman(9.31.13) and I have got the following warning when I upload the file to send the body as a form-data.
"This file isn't in your working directory. Teammates you share this request with won't be able to use this file. To make collaboration easier you can set up your working directory in Settings." How can I solve it?

ar.js how to create a .patt file programmatically on server?

Im using ar.js.
Trying to automatically convert an image to a .patt file for detection.
The only thing I can find is this website which automatically converts jpgs to .patt files.
https://jeromeetienne.github.io/AR.js/three.js/examples/marker-training/examples/generator.html
Even then the github is based on JS I think, so the file is generated on the client, not the server.
This tutorial even says to use the link above to create patt files.
https://medium.com/arjs/how-to-create-your-own-marker-44becbec1105
How could I programmatically create the patt files instead of manually creating them through the website. Ideally with php.
Thanks

check if file exists before download - Qt

I have a URL of a file and I want to download it from the internet. Before downloading, I want to make sure that the file I am going to download actually exists i.e, the URL is correct or the file has not been deleted by the owner. How am I supposed to do so in Qt?

How can i download folder in oneDrive using microsoft graph API | python requests?

I want to download folder and export as zip like we do in google drive. is there is anyway we can do in python requests. is there any endpoint for that?
downloadURL=x["#microsoft.graph.downloadUrl"]
print " download Url : ",downloadURL
I am using this https://graph.microsoft.com/v1.0/users/{user-id}/drive/root:/testing 1/new-file-name.docx. for getting that URL. how can I achieve same for folder.
As per the documentation Only driveItems with the file property can be downloaded. Folders don't have the property. I also don't get how a folder would need to be exported as pdf. I suggest you review your use case and find the files that you need to export to pdf instead of targeting folders.

How to change default location of OpenCart file manager?

After upgrading a website from opencart 1.5 to 2.3 I can't see the old uploaded images in file manager. My files are in /images/data/... while the file manager loads on /images/catalog/ and doesn't let me access any files beyond this folder. Is there a way to change the default location for file manager?
Luckily the older products still have the right links to their images, but since any new will have to be stored under /catalog directory, I will not be able to upload any new ones to already well made file structure.
admin/config.php will give you the directory of your image files, you can also change it to point at the correct location.