Joar Swenning
unread,Dec 22, 2010, 9:27:47 AM12/22/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to RISE
Hello,
The transactionID is generated (and returned) if you supply NULL, i.e.
start an
Upload/download transaction by passing NULL. endOfTransaction is set
when you retrieve
The last part on a download and should be set by you when passing the
last part of an
Upload. For download, the $startReadingAt and $maxBytesToRead
determines what subset
of the binary data to pick; grab no more than $maxBytesToRead starting
at byte
$startReadingAt. Actually, the chunking mechanism doesn't make much
sense when the
file's already uploaded as in your case with a PHP web app.
The samples below shows how to upload/download using RISE methods.
Note that $db is an
instance of a RISE interface object (in this case $db = new
copIDatabase($this->conn);).
The code below calls the method DownloadImageData (a RISE download
method) to fetch the
content of an image in 100kb blocks. When done, the $bytes variable
contains the image.
$ImageID = 123; // ID of image instance
$bytes = NULL;
$imd = (object)array('transactionId' => NULL, 'endOfTransaction' =>
FALSE);
do
{
$imd = $db->DownloadImageData($imd->transactionId,
strlen($bytes), 100000, $ImageID);
$bytes = $bytes.$imd->Data;
} while (!($imd->endOfTransaction===TRUE));
The code below call the method UploadImageData (a RISE upload method)
to write the content
of an image as a single block.
$db->UploadImageData(NULL, TRUE, $ImageID, $bytes);
I hope this helped and if not you might also want to make sure you
have installed tha latest version code generators.
Best regards,
Joar