Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Products photos are disappearing after awhile

Forum

Search UsersRules
Products photos are disappearing after awhile
#1
Active user
Points:: 0
Joined:: Mar 6, 2018

Hello!
I have a problem with product photos. I am saving them in 1C with this code;

&AtClient
Procedure ChangePicture(Command)
  BeginPutFile(New NotifyDescription("ChangePictureAfterPutFile", ThisForm), , , True, UUID);
EndProcedure



&AtClient
Procedure ChangePictureAfterPutFile(Result, Address, SelectedFileName, AdditionalParameters) Export
  If Result Then
     PictureAddress = Address;
  EndIf;
EndProcedure

&AtServer
Procedure AfterWriteAtServer(CurrentObject, WriteParameters)
  If Not IsBlankString(PictureAddress) Then
     Picture = GetFromTempStorage(PictureAddress);
     PictureAddress = PictureAddress;
     CurrentObject.Picture = New ValueStorage(Picture);
     CurrentObject.Write();
  EndIf;
EndProcedure

&AtServer
Procedure OnCreateAtServer(Cancel, StandardProcessing)
  If Not Parameters.Key.IsEmpty() Then
     CurrentObject = Parameters.Key.GetObject();
     PictureAddress = PutToTempStorage(CurrentObject.Picture.Get());
  EndIf;
EndProcedure

Everything is working normally,but after awhile some products starts to loose photos. I am using Microsoft Sql server 2012, 1C version is 8.3.23.1688

Profile
#2
Active user
Points:: 0
Joined:: Mar 6, 2018

I changed the system, I am not writing and reading from 1C database storage. I change to reading from fileserver real images;

ImageField = PutToTempStorage(New Picture(PictureAddress,True));

Problem solved I think :)

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.