How can I upload an excel file into a website?

8 ビュー (過去 30 日間)
Julie SERIS
Julie SERIS 2019 年 10 月 15 日
編集済み: Guillaume 2019 年 10 月 21 日
I have a Matlab program that puts some data into an local excel file, with some page setting. Now, I would like to upload this file into SharePoint so other people can use it (note that I would have to overwrite it if the file already exists). I've found a lot of info on how to download but don't know how to upload... Thank you for your help!

回答 (1 件)

Samatha Aleti
Samatha Aleti 2019 年 10 月 18 日
You may use “webwrite” function to do this. Refer the following document link for detailed understanding on “webwrite” :
  2 件のコメント
Guillaume
Guillaume 2019 年 10 月 21 日
編集済み: Guillaume 2019 年 10 月 21 日
Comment by Julie SERIS mistakenly posted as an answer moved here:
Thank you Samatha for your answer, but can you be more specific? From my point of view, webwrite doesn't allow to upload directly a file on a website
Guillaume
Guillaume 2019 年 10 月 21 日
編集済み: Guillaume 2019 年 10 月 21 日
webwrite will let you upload a file to a website, assuming the website has a mechanism to do this. It's probably possible to do this with sharepoint, but it's not something I've ever done.
Things you'll have to figure out:
  • authentication. It's unlikely you can upload to sharepoint without authentication. webwrite has options to specify username / password
  • actual url to upload to. This might be a completely different url than what you write in a web browser.
  • figure out which method is to be used to upload the data (POST or PUT most likely)
  • maybe more...
edit:
The sharepoint REST API is explained here, since it is a REST API it can be used with webwrite. As I suspected the url you use for REST is different than the one you use with a browser (in particular, it's got _api in it, but figuring out the actual url to your resource will require some work).
The main problem might be authentication. I can't figure it out for the sharepoint sites I've got access to. I know that the url I tried is correct as I get a correct xml response from my browser, but from matlab I keep getting a 403 Forbidden even after specifying my username / password.
Needless to say, uploading documents to sharepoint through the API is far from trivial, but that's nothing particular to matlab. It's the complexity of sharepoint!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by