NetTalk Central

Author Topic: How to use blob instead of filename  (Read 3310 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1849
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
How to use blob instead of filename
« 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
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1849
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: How to use blob instead of filename
« Reply #1 on: January 28, 2009, 11:12:24 AM »
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
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: How to use blob instead of filename
« Reply #2 on: January 28, 2009, 11:22:03 PM »
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

Alberto

  • Hero Member
  • *****
  • Posts: 1849
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: How to use blob instead of filename
« Reply #3 on: January 29, 2009, 03:33:56 AM »
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
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: How to use blob instead of filename
« Reply #4 on: January 29, 2009, 06:48:17 AM »
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


Alberto

  • Hero Member
  • *****
  • Posts: 1849
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: How to use blob instead of filename
« Reply #5 on: January 29, 2009, 08:54:43 AM »
Done.
Works ok (ignoring the setting of the upload folder that does not works).
FIL2BLOB and BLOB2FILE works ok too.
Thanks
Alberto
-----------
Regards
Alberto