Products photos are disappearing after awhile

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 6, 2018
Company: Bodega LLC

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

 
#2
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 6, 2018
Company: Bodega LLC

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 :)

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.