繁体   English   中英

PDF 到 Azure Blob 存储

[英]PDF to Azure Blob storage

我有需要将 pdf 上传到 Azure Blob 的要求。 我有它 base64 编码形式的 pdf 。 应用程序没有任何存储。 是否可以将 base64 转换为 pdf 并将其上传为 pdf 而无需使用 Z923F725A048B4333 代码将其存储在任何位置。

Yes, it's possible to upload a file (PDF) into Azure Storage Account using Java, you need to use Azure Blob Storage client library for Java provided by Microsoft. 几个链接可以帮助您入门;

Microsoft 文档:使用 Java v12 SDK 管理 blob

Azure 存储库 Java

Microsoft 文档:示例代码

// Create a local file in the ./data/ directory for uploading and downloading
String localPath = "./data/";
String fileName = "quickstart" + java.util.UUID.randomUUID() + ".txt";
File localFile = new File(localPath + fileName);

// Write text to the file
FileWriter writer = new FileWriter(localPath + fileName, true);
writer.write("Hello, World!");
writer.close();

// Get a reference to a blob
BlobClient blobClient = containerClient.getBlobClient(fileName);

System.out.println("\nUploading to Blob storage as blob:\n\t" + blobClient.getBlobUrl());

// Upload the blob
blobClient.uploadFromFile(localPath + fileName);

如果此信息可以帮助您继续前进,请考虑接受此答案并进行投票,如果没有,请提供您的反馈。 谢谢。

暂无
暂无

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

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