Exportar (0) Imprimir
Expandir todo

CloudBlob.UploadFile (Método) (String, BlobRequestOptions)

Uploads a file from the file system to a block blob.

Espacio de nombres: Microsoft.WindowsAzure.StorageClient
Ensamblado: Microsoft.WindowsAzure.StorageClient (en microsoft.windowsazure.storageclient.dll)

'Uso
Dim instance As CloudBlob
Dim fileName As String
Dim options As BlobRequestOptions

instance.UploadFile(fileName, options)

public virtual void UploadFile (
	string fileName,
	BlobRequestOptions options
)
public void UploadFile (
	String fileName, 
	BlobRequestOptions options
)
public function UploadFile (
	fileName : String, 
	options : BlobRequestOptions
)

Parámetros

fileName

The path and file name of the file to upload.

options

An object that specifies any additional options for the request.

The following code example uploads a file from the local computer to a blob.

static void UploadBlobFromFile(Uri blobEndpoint, string accountName, string accountKey)
{
    //Create service client for credentialed access to the Blob service.
    CloudBlobClient blobClient = new CloudBlobClient(blobEndpoint, new StorageCredentialsAccountAndKey(accountName, accountKey));

    //Get a reference to a container, which may or may not exist.
    CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");
            
    //Create a new container, if it does not exist
    container.CreateIfNotExist();

    //Get a reference to a blob, which may or may not exist.
    CloudBlob blob = container.GetBlobReference("myfile.txt");

    //Upload content to the blob, which will create the blob if it does not already exist.
    blob.UploadFile("c:\\myfile.txt");
}


Cualquier miembro estático público (Shared en Visual Basic) de este tipo es seguro para subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Plataformas de desarrollo

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 y Windows 2000

Plataformas de destino

Adiciones de comunidad

Mostrar:
© 2014 Microsoft