@_UI_STD_INIT_@[set page_title][L]Upload File[/L][/set] [set page_banner][L]Upload File[/L][/set] [set ui_class]Content[/set] [set page_perm]files[/set] [set icon_name]icon_config.gif[/set] [if-mm function="!files" name="[data session arg]"] [seti ui_error][msg arg.0="[data session arg]"]Not authorized to upload file %s.[/msg][/seti] [bounce page="__UI_BASE__/error"] [/if-mm] @_UI_STD_HEAD_@ [form-session-id] [return-to][comment]This passes the right form vars for return processing[/comment]

[if type=explicit compare=`$Session->{arg} =~ m{[^/]$}`] [msg arg.0="[data session arg]"]Uploading file %s[/msg] [elsif session arg] [msg arg.0="[data session arg]"]Uploading file to %s[/msg] [comment] [L]File to upload[/L]

[/comment] [/elsif] [else] [L]File to upload[/L]

[/else] [/if]

[set existing][/set] [if type=explicit compare=`$CGI->{ui_image_preview} =~ m{[^/]$}`] [set existing]1[/set]
[L]Preview:[/L]
[/if]

[L]Local file[/L]

[L]Upload mode[/L]

> [if session arg =~ /\.(gif|jpe?g|png)$/i] [or cgi ui_upload_binary] [L]ASCII[/L]
> [L]Binary[/L]

> [if scratch existing] [L]Use new file name[/L]
> [L]Use existing file name[/L] [/if] [else] [L]ASCII[/L]
> [L]Binary[/L] [/else] [/if]

[L]Backup mode[/L]

> [if cgi ui_backup] [L]Back up[/L]
> [L]NO backup[/L] [else] [L]Back up[/L]
> [L]NO backup[/L] [/else] [/if]

[button text="[L]Upload[/L]" src="upload.gif"] [calc] if( $CGI->{ui_upload_newfn} or $CGI->{ui_upload_fn} =~ m:/$:) { my $image = $CGI->{ui_upload_file}; $image =~ s:.*[\\/]::; $CGI->{ui_upload_fn} =~ s:/[^/]*$:/:; $CGI->{ui_upload_fn} .= $image; $Session->{ui_message} = sprintf ("[L]Uploaded file: %s[/L]", $image); if($CGI->{ui_preload}) { my $pre = $CGI->{ui_preload} =~ /:/ ? $CGI->{ui_preload} : "$Values->{mv_data_table}:$CGI->{ui_preload}"; #Log("preloading $pre=$image"); $CGI->{ui_return_to} .= "\0ui_preload:$pre=$image"; #Log(qq{actual preload: CGI->{"ui_preload:$pre"} = $CGI->{"ui_preload:$pre"}}); } } $regex = q{@_UI_CONST_IMAGE_REGEX_@} || '\.(?:gif|jpe?g|png)$'; if( $CGI->{ui_upload_fn} =~ m{$regex}i) { $CGI->{ui_upload_umask} = '022'; } return; [/calc] [/button]

@_UI_STD_FOOTER_@