S3DB
Home l Features l Demo l Downloads l Documentation l Webcasts l Blog l
 
 

S3DB - Simple and Sloppy Semantic Database

API for File Managment

The S3DB API can also be used for uploading files into S3DB. This process involves three steps:

  1. Providing S3DB with the key and a filename in order to receive a temporary filekey that will identify each fragment
  2. Uploading the file to a temporary folder by fragments encoded in base64
  3. Inserting the file as a statement


Uploading a file

Uploading large files into S3DB becomes possible using the S3DB module "uploads.php". Files can be sent to this module in packages of base64 encoded string. The file uploading requires the following sequence of steps:

  1. Provide uploads.php with a valid S3DB key and a filename (if provided, filesize will also be used). Both parameters are provided to "uploads.php" using the GET method.

  2. Ex: http://localhost/s3db1.0/uploads.php?key=Y1F2mHOgGSdJjqC&filename=airplane.gif&filesize=9747



  3. Use the filekey to upload the fragments, indicating in each case the order of the fragment being uploaded and the total number of fragments.
    If the fragments were encoded individually use encode=2 (encode=1 or empty encode expect the entire file to have been encoded at once)

  4. Ex: http://localhost/s3db1.0/uploads.php?filekey=RXvYe0xzWoKr&fragNr=1/4&encode=1
    &fileStr=d2VyZSB5b3Ugc21hcnQgZW5vdWdoIHRvIGRlY29kZSB0aGlzIHN0cmluZyBhbmQgc2VlIHdoYXQgaXQgc2F5cz8gOy0pIA==


    Note: The variables filekey, fragNr, encode and fileStr can also be sent using a POST instead of a GET

  5. Once all the fragments have been uploaded, insert the file on S3DB using the S3QL insert file query (see Insert queries). If this step is not completed, the temporary uploaded file will be deleted.


Previous/Table of Contents

Email: helenadeus@gmail.com, almeida.jonas@gmail.com


Home l Features l Demo l Downloads l Documentation l Webcasts l Blog l


© 2006 Helena F Deus & Jonas Almeida
http://www.2serveu.net