image - how to upload to kinvey only once -
i made program in delphi upload picture kinvey provider, first program saves image timage component in specific dir upload kinvey, issue every time open program uploads kinvey, how make sure upload 1 time if opened program multiple times
image1.repaint; image1.bitmap.savetofile('some dir'); procedure ttabbedwithnavigationform.timer2timer(sender: tobject); var fn : string; lstream : tfilestream; lfile : tbackendentityvalue; begin fn := 'the file dir'; try lstream := tfilestream.create(fn, fmopenread); backendfiles1.files.uploadfile(fn,lstream, 'image/png',lfile); lstream.free; backendfiles1.free; end; end; end.
the name of method "timer2timer" suggests code triggered... timer component named timer2. ;-)
check timer activated. if enabled @ design time, event called defined time has elapsed, independently user interaction.
btw: use try/finally-block streams, stream creation should directly before "try" (else trigger block if creation of stream fails, , getting access violation because stream variable not initialized).
the call of "backendfiles1.files;" inside finally-block seems obsolete me, should do?
Comments
Post a Comment