Click or drag to resize

IDatabaseImportBlobFromFile Method

Copy a file into the database. Returns the blob record id.

The *.dsc file has information regarding the file mapping and what file should be imported (and where is it located).

There are 1 import description and 1 import text file available under \Examples\Import. Copy this to C:\Imp, and the example code will perform a successful import.

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
int ImportBlobFromFile(
	string conceptualtype,
	string filename,
	string extrainfo = "0",
	bool zipCompress = false,
	bool encrypt = false
)

Parameters

conceptualtype
Type: SystemString
String - type of the blob ex: PersonImage, ProjectImage...
filename
Type: SystemString
String - name of the file to be imported
extrainfo (Optional)
Type: SystemString
String - Additional info about the blob.
zipCompress (Optional)
Type: SystemBoolean
Default FALSE - TRUE if the file is to be zipped (compressed) when importing
encrypt (Optional)
Type: SystemBoolean
Default FALSE - TRUE if the file is to be encrypted when importing

Return Value

Type: Int32
True if the import was successful. long - the id of the blob
Examples

Import data

This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.

VB
dim objdb
set objdb = CreateObject("superofficedb.database")
If Not (objDB is Nothing) Then
    objdb.login  "<username>", "<password>"
    if  (objdb.import("c:\imp\projmemb.dsc"))=true  then
        msgbox "import successful", vbinformation  + vbokonly, "supercom"
    end  if
else
    msgbox  "unable to connect to database"
end if
set objso = nothing

Import/export a picture

VB
dim objSO
set objSO = createobject("SuperOfficeDB.Database") 
If not (objSO is nothing) Then
    objSO.login "<username>", "<password>" 
    blobId = objSO.ImportBlobFromFile ("jpg", "c:\MyPicture.jpg")

    objSO.ExportBlobToFile blobId, "c:\exportedMyPicture.jpg"

else
    msgbox "Unable to log in"
end if
set objSO = Nothing

See Also