Azure的斑点不存储PDF文件 [英] Azure Blob Not Storing PDFs

查看:125
本文介绍了Azure的斑点不存储PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

行,所以我有以下的code--它完美存储的JPG文件,但不存储的PDF文件。任何想法,为什么?

Ok so i have the following code-- it works perfectly for storing jpgs, but does not store pdfs. Any idea why?

 public bool TryStoreImage(string uri, string fileName)
    {
        try
        {
            WebClient wc = new WebClient();
            var blob = new BlobStorage().GetCloudBlobContainer();

            var store = blob.GetBlobReference(fileName);
            store.UploadByteArray(wc.DownloadData(uri));
            return true;
        }
        catch (Exception exc)
        {
            return false;
        }
    }

`

此外,每一个PDF我尝试访问给我的PDF不存在,即使我可以看到蔚蓝的管理画面的PDF格式。每JPG但是我店是完全访问。

Again, every pdf i try to access gives me "pdf does not exist," even though i can see the pdf in the azure management screen. Every jpg i store however is perfectly accessible.

推荐答案

你是什么所说的PDF不存在?什么工具告诉你?你是如何访问BLOB?如果不知道,这是不可能真正搞清楚,但我猜测,缺乏内容类型是一个问题。尝试 store.Properties.ContentType =应用程序/ PDF

What do you mean by "pdf does not exist?" What tool is telling you that? How are you accessing the blob? Without knowing that, it's impossible to really figure it out, but I'd speculate that the lack of a content-type is a problem. Try store.Properties.ContentType = "application/pdf".

- smarx

– smarx

这篇关于Azure的斑点不存储PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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