string or binary data would be truncated when upload a photo

Good morning I am trying to save an image in a table that has a binary field and when I do it from the pc it does not give me an error, but when I do it from the mobile I get the error.

i´m using popup_upload_GetFile


Thanks

Carolina Gutierrez wrote:

Good morning I am trying to save an image in a table that has a binary field and when I do it from the pc it does not give me an error, but when I do it from the mobile I get the error.

Can you share the error, so that folks here can help you.

thanks



Error Detail
Back to Log
Id:
3a3d3456-c39d-4d80-9816-a1daab96176b
Time of Log:
2019-03-08 08:53:02
eSpace:
CheckList
Tenant:
Users
User:
 (1193)
Session Id:
mbz4sucvza1hqwj2ble3yb1o
Server:
E2OIT-DV3N8N
Module:

Message:


String or binary data would be truncated.
The statement has been terminated.


Environment InformationeSpaceVer: 1477 (Id=24811, PubId=25974, CompiledWith=10.0.828.0)
RequestUrl: https://galpenergia-dev.outsystemsenterprise.com/CheckList/Comenzar.aspx?_ts=1552035181132 (Method: POST)
AppDomain: /LM/W3SVC/1/ROOT/CheckList-1380-131964462638750265
FilePath: d:\OutSystems\Platform Server\running\CheckList.1748618165\Comenzar.aspx
ClientIp: 31.221.190.218
Locale: en-US
DateFormat: yyyy-MM-dd
PID: 6168 ('w3wp', Started='3/1/2019 10:58:51 AM', Priv=2278Mb, Virt=11459Mb)
TID: 443
Thread Name:
.NET: 4.0.30319.42000
Stack:
String or binary data would be truncated.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService.ExecuteReader(IDbCommand cmd)
   at OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService.ExecuteScalar(IDbCommand cmd)
   at OutSystems.Internal.Db.Command.ExecuteScalar(String description, Boolean isApplication, Boolean skipLog, Boolean applyTransformationsToParameters)
   at ssCheckList.ExtendedActions.CreateItemPictureTemp(HeContext heContext, RCItemPictureTempRecord inParamSource, Int64& outParamId)
   at ssCheckList.Flows.FlowUIFlowMantenCheck.ScrnComenzar.CommandPruebaPopUpUpload(HeContext heContext)

That is actually an SQL Server error. It happens when you try to insert/update a record on the database, with some value that is larger than the database field can hold.

For example, if you create an entity Person, and an attribute Name with Length 50 (which is the default), then it can only store texts up to 50 characters in length. If your user tries to insert a larger name, your application will display that error.

The solution is to identify which is the field that has too small of a Length, and then simply increase it.