NetTalk Central

Author Topic: Download a blob  (Read 3493 times)

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Download a blob
« on: November 24, 2015, 09:14:07 AM »
Clarion 10
Nettalk 8.66
Postgres Backend

Have a browse that downloads a blob.
The code I use on on another browse doing the same thing works just fine.
On the problem browse I get the error:

The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

The code follows:
        DO OpenFiles
        Loc:RecordID = p_web.GetValue('TID')
        dt:TemplID = Loc:RecordID
        IF Access:doctempl.Fetch(dt:pk_dtmpsysid) = Level:Benign
            bs# = dt:tmplblob{PROP:Size}
            IF bs# > 0
                loc:dir = p_web.GSV('UploadPath')
                IF loc:dir <> ''
                    IF ~EXISTS(loc:dir)
                        CreateDirectory(loc:dir)
                    END
                END
                loc:fileName = p_web.GSV('UploadPath') &'\' & '$$$' & dt:TemplateName
                MESSAGE(loc:FileName)
                loc:brname   = dt:TemplateName
                IF BLOBTOFILE(cvfd:CustVFBlob, loc:fileName)
                    MESSAGE(loc:fileName & ' did not transfer properly')
                    MESSAGE('Invalid Document for the following ERRORCODE: ' & ERRORCODE())
                ELSE
                    p_web.HeaderDetails.ContentDisposition = 'attachment; filename="'&loc:brname &'"'
                    p_web.SetValue('_parentPage','ServeTemplates')
                    p_web.publicpage = 1
                END
            END
        END
        DO CloseFiles

Any ideas why not working?

Thanks.
Brian

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Download a blob
« Reply #1 on: November 26, 2015, 01:49:29 AM »
Example required.

Cheers
Bruce