[uploadVars]

Description

Link: [uploadVars]
Author: Alex Pilson
Category: Utility
Version: 8.5.x
License: Public Domain
Posted: Jul. 03, 2007
Updated: Jul. 03, 2007
More by this author...
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.

Parameters

none


Sample Usage

iterate(file_uploads, var('uploadArray'));
		
			uploadVars('uploadArray');'<br>';
			$mapRef;'<hr>';
			
/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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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');'<br>';
			$mapRef;'<hr>';
			
		/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

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net