简体   繁体   English

如何通过与 Wordpress 相同的结构通过 Laravel 将文件上传到 Azure

[英]How to upload files to Azure via Laravel with same structure as on Wordpress

I have a wordpress based website which has more than 1000 posts and relevant images (more than 5k), galleries etc. Now the project has been converted to Laravel.我有一个基于 wordpress 的网站,其中包含 1000 多个帖子和相关图像(超过 5k)、画廊等。现在该项目已转换为 Laravel。 I would like to migrate/move all the images from Media of existing wordpress to new Azure server where Laravel project is hosted.我想将所有图像从现有 wordpress 的媒体迁移/移动到托管 Laravel 项目的新 Azure 服务器。 I'm already able to successfully upload one be one file with Request method to Azure server by setting up default storage to Azure.通过将默认存储设置为 Azure,我已经能够使用请求方法成功地将一个文件上传到 Azure 服务器。 But not sure how I should upload all the files/images from existing wordpress to Azure with Laravel so that same folders/files strucutre and names are maintained as currently on wordpress. But not sure how I should upload all the files/images from existing wordpress to Azure with Laravel so that same folders/files strucutre and names are maintained as currently on wordpress.

Btw, I already have extracted sql/csv/json list of all the absolute paths of images from existing wordpress.顺便说一句,我已经从现有的 wordpress 中提取了图像的所有绝对路径的 sql/csv/json 列表。

I am not so familiar with Laravel / WordPress + I am not even sure I got your question right.我对 Laravel / WordPress 不太熟悉 + 我什至不确定我的问题是否正确。 But, it might still be useful for you.但是,它可能仍然对您有用。 So let me know所以让我知道

If you have a certain structure of files within directories and you want to maintain that, you can simply upload your directories recursively to Azure's Storage account.如果您在目录中有特定的文件结构并且想要维护它,您可以简单地将您的目录以递归方式上传到 Azure 的存储帐户。 Check the blob storage option, Create a container.检查 blob 存储选项,创建容器。 And there is a wide variety of ways to upload your files to it, one of the most simple ways is to use AzCopy (CLI tool proposed by Microsoft) If you wish to stick with REST API, that's an option too.并且有多种方法可以将文件上传到其中,最简单的方法之一是使用 AzCopy(Microsoft 提出的 CLI 工具)。

Hope I got it right希望我做对了

Take care小心

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM