NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto on January 28, 2009, 08:31:21 AM
-
Hi,
How can I upload an image and store it in a blob field?
I need the same functinality of web26 (FileUpload) example but using blob instead of storing images in the upload folder.
Thanks
Alberto
-
By the way, I was looking at the web40 example but I dont undertant it very well. It seams it for download and I need that when the user Uploads the file it stores in a blob.
I was trying with the clarion func. FILETOBLOB but the exe blows up!
Thankas again
Alberto
-
Hi Alberto,
In the example 40 folder is a second app, a non web app, that shows how to move a file into a blob.
So start by adapting your server so that after a file is uploaded it is moved into the blob, and the original upload, on disk, is deleted.
You'll need to read the code in AddBlob and then copy appropriate parts of it into your web server.
Cheers
Bruce
-
OK, understood.
Which is the embeed point "after a file is uploaded" to call that AppBlob exe?
THe example 40 needs a template I don have.Can do it with FILE2BLOB? AND BLOB2FILE?
Thanks
Alberto
-
Hi Alberto,
>> Which is the embed point "after a file is uploaded" to call that AppBlob exe?
WebHandler procedure
HandleFile method
after parent call.
the REturnValue from the parent call contains the name of the file stored on disk, relative to the "web" folder.
ie the _whole_ name of the uploaded file is
CLIP(self.site.webFolderPath) & '\' & ReturnValue
>> THe example 40 needs a template I don have.Can do it with FILE2BLOB? AND BLOB2FILE?
No idea, I've never tried.
Cheers
Bruce
-
Done.
Works ok (ignoring the setting of the upload folder that does not works).
FIL2BLOB and BLOB2FILE works ok too.
Thanks
Alberto