NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: osquiabro on March 09, 2015, 05:46:57 PM
-
Clarion 10 11643
NT 8.38
I try to create a File Upload to blob but NT generate error with a field, is define as blob in my dct with binary check.
i attach app with dct..
[attachment deleted by admin]
-
Hi Osa,
Thanks for the example - it shows the root of the problem.
Basically the File Uploader is really expecting you to use 2 fields in the case of a blob - ont to holfd the "File name" and the Blob to hold the file contents.
Because you have set the "Field Name" to be the blob field - that's what is generating all the errors. Typically this should be a String field in your table, which will hold the "name" of the file being uploaded.
If you change to that you should be ok.
cheers
Bruce
-
i change the fields and compile ok but don't work to save a blob, i don't if is compatible with SQL Server, my blob field is requiered in database and when try to save the field is null, the image is downlod correctly in upload directory but not to database.
[attachment deleted by admin]
-
it looks like you have a constraint on the blob field to not allow nulls. Is that the case?
cheers
Bruce
-
yes is the case, but without null restriction same problem.
I have a same problem that this post :
http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&topic=5502.0
with sql server the blob field is clear before save a record i try this code in SaveFile Routine :
IF FileToBlob(Doc:DocName,Doc:DocContent) !returns an ERRORCODE if copy fails
MESSAGE(CLIP(Doc:DocName) & ' was not copied - ERRORCODE: ' & ERRORCODE())
END
message(Documents.DocContent{PROP:Size})
This code is a same that a desktop app
this code don't generate any error the blob field have a size but don't why the value is clear before save a record.
With TPS work perfect.
-
i see the CheckForDuplicate Routine delete the value of blob field with sql server i add this codefor ommit the routine and work:
what is wrong?
CheckForDuplicate Routine
If loc:invalid <> '' then exit. ! no need to check, record is already invalid
If ans = 0 then exit. ! no need to check, as no action happening
! Start of "On Insert / Copy / Update : Checking for Duplicate : before disk write (start)"
! [Priority 5000]
if 0=1
! End of "On Insert / Copy / Update : Checking for Duplicate : before disk write (start)"
If p_web.GetSessionValue('UpdateDocuments:Primed') = 0 and Ans = Net:InsertRecord
Get(Documents,0)
End
! Check for duplicates
If Duplicate(Doc:PK_Documents)
loc:Invalid = 'Doc:DocId'
if not loc:alert then loc:Alert = clip(p_web.site.DuplicateText) & ' PK_Documents --> '&clip('Doc Id:')&' = ' & clip(Doc:DocId).
End
! Start of "On Insert / Copy / Update : Checking for Duplicate : before disk write (end)"
! [Priority 5000]
end
-
this code cause the problem:
If Duplicate(Doc:PK_Documents)
i think that the problem is because i have a identity field for my primary key, and this moment the value is 0 and cause the error.
-
another issue, the technique of NT for save a blob in sql server save a corrupt file but with this code in Valide Insert Routine work perfect:
i#=FileToBLOB(p_web.GSV('Cod:DocumentDescription'),Cod:DocumentContent)
-
>> another issue, the technique of NT for save a blob in sql server save a corrupt file
try with 8.41
-
don't work entirely, if upload a pdf fine, but any image failed