Lasso Soft Inc. > Home

[uploadVars]

LinkuploadVars
AuthorAlex Pilson
CategoryUtility
Version8.5.x
LicensePublic Domain
Posted03 Jul 2007
Updated03 Jul 2007
More by this author...

Description

Creates vars of the upload map elements. Optionally alowing to prepending the var name. A refmap is also created to view the newly created vars.

Sample Usage

iterate(file_uploads, var('uploadArray'));
		
			uploadVars('uploadArray');'
'; $mapRef;'
'; /iterate;

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

	define_tag(
	'uploadVars',
	-required='iterator',
	-priority='replace',
	-optional='pre',
	-description='Creates vars of the upload map elements. Optionally alowing to prepending the var name. A refmap is also created to view the newly created vars.'
);
	
	local('p' = local('pre'));
	var('mapRef' = map);
	
	local('u' = var(#iterator));

	
/*
		OPTIONS:
		use the iterator to pass the varibale being used to extract each iteration of the file_uploads.
		
		
		Returns the following example:
		VAR NAME		: VALUE ASSOCIATED
		----------------------------------------------------------
		type 			: image/jpeg
		origname		: asa-hs-musical.jpg
		fieldname		: file1
		type			: image/jpeg
		param			: file1
		realname		: asa-hs-musical.jpg
		size			: 487659
		origpath		: 
		path			: ///var/tmp/lasso-tmphWT7S590722308.uld
		size 			: 487659
		origextension 	: jpg
		name 			: ///var/tmp/lasso-tmphWT7S590722308.uld
		file 			: 
		
		iterate(file_uploads, var('uploadArray'));
		
			uploadVars('uploadArray');'
'; $mapRef;'
'; /iterate; */ file_uploads->size == 0 ? return(''); iterate(#u, local('e')); local('newname' = #p + (#e->first)->replace('upload.','') &); var(#newname) = #e->second; $mapRef->insert(#newname = var(#newname)); /iterate; /define_tag;

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft