Thanks Sukesh,
The problem was mine, it was working, but as an idiot I was developing om my laptop and testing at the unix server (@ desktop it was fine !!).


Thank you anyway,
This might help somebody else.

Nuno

Sukesh Hoogan wrote:
Nuno

Check-out to see if this helps.

http://personal.vsnl.com/sukesh_hoogan/cwcsp.html#Nbr05

Regards
Sukesh Hoogan

Nuno Canas <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

What's wrong with this code ?

LoadPicture(empid,filename)
file://Set imgfile=%request.MimeData("FileStream",1).FileName
Set imgfile=##class(%FileBinaryStream).%New()
file://Do imgfile.Open("RU") ; same flags as OPEN command--use "U" for

streams

; now open a Person object containing a Memo stream
; it does not matter what kind of stream Memo is...
file://set filename="c:\benedito.jpg"
Set emp=##class(ECOM.Empregado).%OpenId(empid)
set imgfile.Filename = filename

write "alert('Image file Size : "_imgfile.Size_"');",!

; copy the file into Memo
set rf=emp.Foto.CopyFrom(imgfile)
w "alert('ReadFile:"_filename_"--"_rf_"');",!

set ss=emp.Foto.SaveStream()
w "alert('SaveStream:"_ss_"');",!
; save the person object and close it
set sc=emp.%Save()

w "alert('Size:"_emp.Foto.Size_"');",!

w "alert('Status:"_sc_"');",!
Do emp.%Close()

; close the file
Do imgfile.%Close()








Reply via email to