我嘗試將圖像從android上傳到Azure Blob存儲。我可以通過這種方式來自andriod的Azure blob存儲
CloudStorageAccount storageAccount = CloudStorageAccount.parse(storageConnectionString);
// Create the blob client.
CloudBlobClient blobClient = storageAccount.createCloudBlobClient();
CloudBlobContainer container = blobClient.getContainerReference("mycontainer");
final String filePath = "C:\\Users\\icon.jpg";
CloudBlockBlob blob = container.getBlockBlobReference("1.jpg");
File source = new File(filePath);
blob.upload(new FileInputStream(source), source.length());
從Java做,但如果我改變文件路徑爲「內容://媒體/外部/圖像/媒體/ 12」這一點,在android系統我有FileNotFoundException異常。我怎樣才能從android上傳圖片?
是否有你在你的代碼中指定的路徑下的文件? –