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

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.

Related

How to updatde current URL while uploading document in SharePoint 2013 using CSOM

I am trying to change URL while uploading document to SharePoint document library using CSOM.
Description:
We have 'XYZ' document library with following folder structure:
Folder 1
SubFolder 1
- All Documents
Now I am trying to upload document at Folder 1. and after Drag and Drop document is getting uploaded to Folder 1. What I want to do here is, Whenever user try to upload document in Folder 1, it should get uploaded to SubFolder 1 . Is there any way to change URL of document in CSOM while its getting uploaded. So that it will get uploaded to 'SubFolder 1' even though user is doing DRagDrop to 'Folder 1'.
I am getting current folder URL in state.Status= Uploading event. I want to update this URL by adding 'Subfolder 1' to currentURL , so that it will upload this document direct to updated URL.
Note: If you have any other way to do it please let me know. also Cant go for Server side code. need CSOM.
Thank you in advance.
I have implemented similar requirements before and would recommend using a workflow for this. I have left out the step for getting the FormDigestValue by making a call to /_api/web/contextinfo, but that is needed in the request header.
The following URL format is used to call the API to move the document. Here is some documentation on the API.
/_api/web/getfilebyserverrelativeurl('/Folder1/file.pdf')/moveto(newurl='/Folder1/SubFolder1/file.pdf',flags=1)

Whole new project inside a jekyll project

I have some website projects that I want to show case that have their own index.html files.
I want to make a route in my Jekyll website so that if I go asdf.com/project1/ I would see simply my project1.
Is this possible to do?
My project is deployed on amazon AWS S3 buckets, hosted on Cloudfront. Should I upload to the bucket and set up some kind of routing?
How would I go about doing this?
Thanks.
If you want S3 to show a specific HTML page when navigating to asdf.com/project1/ the easiest way to achieve this is by creating a file with corresponding key project1/index.html in that bucket.
Source here (bottom of page): http://docs.aws.amazon.com/AmazonS3/latest/dev/IndexDocumentSupport.html
You have two options, put those pages inside Jekyll as "projectname/index.html" or an html file without extension.
If you don't want Jekyll to process them and just use the html do not add front matter to it and jekyll will just copy them to the output folder.
Then you may need to set the right content type when uploading the website to the S3 bucket.
You may find helpful to put that into a script: https://simpleit.rocks/having-pretty-urls-in-a-jekyll-website-hosted-in-amazon-s3/

dotCMS backup from .zip

I have a problem with dotCMS. I have a site which is uploaded to the Internet and I want to export it to take care of this site locally on my computer. I've downloaded all data/assets from Maintenance -> Export dotCMS Content. I have a zip file with all content from this site. I managed and configured dotCMS locally on my computer. I have no idea how I can get access in dotCMS to my site from that zip file. In Maintenance menu I have no option to upload this site. I've read about folder dotCMS/starter.zip but I don't have anything like that. Can anyone tell step by step, how can I manage my site from zip file locally? Thx
Create a new database for dotCMS and replace the starter.zip with your downloaded .zip. Start dotCMS and it should import your site on initial startup. There are some caveats - the databases and versions should match from the server you've downloaded the .zip from.
So to add a couple things to Will's answer in case a few more details help:
The easiest way to do what Will advised may be to start with a new dotCMS distribution.
Make sure the versions of both dotCMS and the database in the new installation match those of the site you made the backup from.
Go through all the normal install steps (including setting up a database), but before you actually start dotCMS, replace the starter.zip file in the ROOT (/dotserver/tomcat-8.0.18/webapps/ROOT) with your own ZIP file (renaming your file to starter.zip).
Alternately, if you want to start with an existing install.
You still need to make sure the dotCMS and database versions match those of the site you backed up.
You still need to replace the starter.zip file with your backup ZIP file.
In addition, make sure you create a new DB (and update the context.xml file to point to it) before you start up dotCMS. If you don't do this, the starter.zip file (your backup) will not get read when dotCMS starts up.

python upload image from a url to google drive api

For my Python app,I had completed the basic settings to interact with google drive api and found it working by a test upload of a CSV file. Now I need to upload an image from a url to a newly created folder named 'myappname' in Google Drive.
Thanks in advance
For now, there is no way you can directly upload file from url. There are two workaround I can think of
Download file and upload it back using Files.insert()
Use Save to Drive button
Using save to Drive button requires user interaction to click the button which might not be the one you want. In that case, downloading and uploading is the only way I can think of.

where is the Yuidoc data.json address for ember?

I want to merge the ember.js documentation into my local yuidoc documentation for my project since many of my objects extend Ember Objects.
The Yuidoc Documentation says I can put a property "external.data" in my yuidoc.json file with the address to an external data.json file. Is this file available? If not, can it be made available so those of us documenting our ember projects can auto-sync to ember's documentation?
I believe the file is generated when you run 'yuidoc .' and it is located in the same dir as the index.html file that is built for API documentation (the root of the api docs). There is a file in the git repo here that looks like it might've been generated by this data.json file but it obviously does not contain json format. It would be nice if this data.json file were made available at the root of the published api docs on the ember website
We don't currently commit this file. Can you open an issue on https://github.com/emberjs/website so we can address this?