0

I'm trying to write a text file to the blob. I know i have to create a container and a blob. I need to write something like this:

$text = 'some text';
$myFile = "file.txt";
$fh = fopen($myFile, 'w') or die("can't open file c");
fwrite($fh, $json);
fclose($fh);

The question is I want to write this php script but using blob ( we dont have access to the file the system ) how can I do that?

2
  • 1
    But...? Where's the question? Commented May 31, 2012 at 13:17
  • I want to write the same script, but it doesnt work with azure, i I dont have access to the file system. Commented May 31, 2012 at 15:01

1 Answer 1

1

After saving the file to disk you'll need to upload it to a container:

_storageClient->putBlob('mycontainer', 'file.txt', 'file.txt');

You can do this by using the Windows Azure PHP SDK. Follow this tutorial for more information: Put a Blob in a Blob Container

Sign up to request clarification or add additional context in comments.

2 Comments

but how I can write/append a text to the file?
how can i do the fwrite part? I can only provide the file path, not the content

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.