Jun 03, 2013; 16:38
French, Shelane
trouble uploading png images
I have no idea why I can upload jpg and gif files will no problem. When I
try to upload png files, it just spins forever never doing anything. I'm
not sure how to track down this problem.
local('output' = map);
if(file_uploads);
local('maxwidth' = 1200, 'maxheight' = 1200, 'File_Temp' = string,
'path'='/photos/');
Iterate(File_Uploads, #File_Temp);
if(#File_Temp->find('Type') >> 'image');
local('file' = (action_param('addrimg') ?
string_replace(action_param('addrimg'), -find=' ', -replace='') |
string_replace(#File_Temp->find('Upload.RealName'), -find=' ',
-replace='')));
local('ext' = (#File_Temp->find('OrigExtension')));
#file->replace(#ext, '');
#file = safe_filename(#file);
#file = #file->substring(1,25);
#ext->Lowercase;
#file->Lowercase;
local('pre' = 1);
while(file_exists(#path #file '_' #pre '.' #ext));
#pre += 1;
/while;
#file = #file '_' #pre '.' #ext;
File_Copy(#File_Temp->find('Path'), (#path #file));
local('location' = #path + #file);
local('myimg' = image(#location));
if((#myimg->width > #myimg->height) && (#myimg->width > #maxwidth));
#myimg->scale(-width=#maxwidth, -thumbnail);
else(#myimg->height > #maxheight);
#myimg->scale(-height=#maxheight, -thumbnail);
/if;
#myimg->save(#location);
#output = map('filename'=string(#file));
else;
#output->insert('error' = 'file');
#output->insert('filetype' = #File_Temp->find('Type'));
/if;
/Iterate;
/if;
#############################################################
Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Jun 05, 2013; 07:31
Fletcher Sandbeck
Re: trouble uploading png images