我可以在 azure 网站上写入文件系统吗? [英] Can I write to file system on azure web site?

查看:35
本文介绍了我可以在 azure 网站上写入文件系统吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以写入 azure 网站上的文件系统吗?例如从仪表板更新或安装 Wordpress 中的插件/主题.AFAIK,这在 Heroku 上是不可能的,那么 Azure 网站呢?

Can I write to file system on azure Web Site? for example updating or installing plugins/themes in Wordpress from dashboard. AFAIK, it is not possible on Heroku so what about Azure Web Sites?

推荐答案

当然可以写在Azure网站的文件系统上.但是,您的写入权限仅限于应用程序的根文件夹.因此,如果您使用 ASP.NET,您应该能够在 Server.MapPath("~/from_here_on") 中的任何位置编写代码.这意味着您应该能够对位于应用程序根文件夹及以下的文件执行读/写/删除操作.如果你使用 PHP,根文件夹可以从 $_SERVER['DOCUMENT_ROOT'] 环境变量中获取.

Surely it is possible to write on the file system of Azure Websites. However your write permissions are limited to the root folder of your app. So, if you use ASP.NET, you shall be able to write anywhere within the Server.MapPath("~/from_here_on"). Meaning you shall be able to perform read/write/delete operations on files which are located in the root folder of your app and below. If you use PHP, the root folder can be get from $_SERVER['DOCUMENT_ROOT'] environment variable.

Web 应用程序不需要更多权限.肯定不能在操作系统文件夹上写.

And a web application shall not need more privileges. For sure will not be able to write on the operating system folders.

这篇关于我可以在 azure 网站上写入文件系统吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆