Nov 05
bienvenue A weird case where image->save changes the image file name provided
Nov 05, 2014; 22:10
bienvenue
A weird case where image->save changes the image file name provided
Hi list
Lasso 8.6 / CentOS 6.5
we have a form to upload and display an image on screen.
Iterating File_Uploads, checking errors, the code processes the upload file and first sets the name as follow :
local: 'name' = #catalogue->structure_id'_'#catalogue->reference'.'(#temp->Find: 'OrigExtension');
Where #temp is an iteration within File_Uploads
That is intended to define the real file name as "234_234567.jpg" for instance.
Then we process the file for scaling in 3 different ratio/size
Each time we use ->save to… save the file in the right directory and it's name in database.
As in :
#medium->save( #folder_M #name ) ;
or
#small->save( #folder_S #name ) ;
The file path should be as /Path/folderNameForSmall/234_234567.jpg
File is saved in the right folder but sometimes the name is changed in a very weird way.
The value of #name saved in DB is ok, checked with an output on screen…
output of #small->File shows sometimes a different name
From our tests, we noticed that the problem never happened with a #name content with letter as "my_image.jpg" for instance
Or with group of digit more or less than 6, it seems that sometimes when the name contains part with exactly 6 digits the name of the file is changed as ->save occurs…
For instance theese are OK :
Name "my_image.jpg" = File = "my_image.jpg"
Name "my_1234567.jpg" = File "my_1234567.jpg"
Name "7281923-6669803.png" = File "7281923-6669803.png"
Name "7281923-666980.png" = File "7281923-666980.png"
Name "1-289164.png" = File "1-289164.png"
Name "728-289164.png" = File "728-289164.png"
But here file name is changed :
Name "728192-666980.png" ≠ File "728192-666980.gng" Here the extension has change !
Name "12-666980.png" ≠ File "12-666080.png" Here 9 becomes 0 !
Name "12-632075.png" ≠ File "12-632575.png" Here 0 becomes 5 !
Name "11-132725.png" ≠ File "11-132525.png" Here 7 becomes 5 !
In this cases the file real name is NOT as intended in the real folder ! so the image cannot be displayed on screen from recorded name in DB
the ->save has changed the content of the name ?!
Well. We will change our naming convention by adding a letter in the name, it seems to work…
But, if any of you has a hint about what happens in our case, we'll take it !
Regards
JPK
----
E SYSTEMES - Lille France
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Nov 05
Steve Piercy - Website Builder Re: A weird case where image->save changes the image file name provided
Nov 05, 2014; 13:27
Steve Piercy - Website Builder
Re: A weird case where image->save changes the image file name provided
Nov 06
bienvenue Re: A weird case where image->save changes the image file name provided
Nov 06, 2014; 09:38
bienvenue
Re: A weird case where image->save changes the image file name provided
Nov 06
Steve Piercy - Website Builder Re: A weird case where image->save changes the image file name provided
Nov 06, 2014; 00:50
Steve Piercy - Website Builder
Re: A weird case where image->save changes the image file name provided
Jan 30
bienvenue Re: A weird case where image->save changes the image file name provided
Jan 30, 2015; 18:37
bienvenue
Re: A weird case where image->save changes the image file name provided