I’m new to PHP so this is probably a super trivial task:
Right now I’m uploading files to a blob from within the script without allowing the user to select a particular file:
$result = $storageClient->putBlob('testcontainer', 'example.txt', 'C:/example.txt');
// Syntax: putBlob (ContainerName, NameInStorage, FileLocation)
I’d like to offer the user three input boxes so that he/she can upload three files to the blob in one go. Something like this:
//GetFile1Location();
//GetFile2Location();
//GetFile3Location();
$result = $storageClient->putBlob('testcontainer', 'example.txt', 'File1Location');
$result = $storageClient->putBlob('testcontainer', 'example.txt', 'File2Location');
$result = $storageClient->putBlob('testcontainer', 'example.txt', 'File3Location');
// Syntax: putBlob (ContainerName, NameInStorage, FileLocation)
I’ve looked at the w3schools tutorial for file uploading but I think all I need is a means to select a file and pull its path; putBlob seems to take care of the actual uploading. I’m just having a bit of trouble with the “GetFileLocation” action.
Any tips would be much appreciated.
I may be dating myself (and my php skills here), but it should just be a matter of doing the file selection/upload as you would normally. Then you just stream the file from its temporary location into the blob container via the code you have already laid out. You can find an example of doing the file upload at http://www.tizag.com/phpT/fileupload.php
I’ll work up a code sample for you over the weekend (simply don’t have time today).
Jan 20th Update
Sorry it took so long, but here’s the promised code sample.