[text]page_title=Upload File[/text] [text]helpid=upload_file[/text] [!]=====================================================================[/!] [!] Process forms [/!] [!]=====================================================================[/!] [formvariables] [showif [url][name][/url]^[url]"cart"[/url]] [text]cart2=[value][/text] [/showif] [showif [url][name][/url]^[url]sku[/url]] [text]sku=[value][/text] [/showif] [!]=====================================================================[/!] [!] Get target path info [/!] [!]=====================================================================[/!] [Text]TargetPath=ad_images/[/Text] [!]----- Content-Disposition: form-data; name="thefile"; filename="D:\A\ProDraw\animal_001.gif" Content-Type: image/gif -----[/!] [showif [url][name][/url]^[url]"theFile"[/url]] [showif [url][name][/url]^[url]filename=""[/url]] [text]sourceSpecified=No[/text] [/showif] [hideif [url][name][/url]^[url]filename=""[/url]] [text]sourceSpecified=Yes[/text] [/hideif] [Text]temp=[Middle StartAfter=filename=][name][/Middle][/Text] [Text]SourcePathNameExt=[Middle StartAfter="&EndBefore="][temp][/Middle][/Text] [ListWords Words=[SourcePathNameExt]&Delimiters=/\] [Text]SourceNameExt=[word][/Text] [/ListWords] [text]sourceValid=No[/text] [showif [url][name][/url]^[url].gif[/url]] [text]TargetExt=gif[/text] [text]sourceValid=Yes[/text] [text]TargetNameExt=[SourceNameExt][/text] [text]TargetPathNameExt=[TargetPath][TargetNameExt][/text] [/showif] [showif [url][name][/url]^[url].jpg[/url]] [text]TargetExt=jpg[/text] [text]sourceValid=Yes[/text] [text]TargetNameExt=[SourceNameExt][/text] [text]TargetPathNameExt=[TargetPath][TargetNameExt][/text] [/showif] [/showif] [/formvariables] [!]=====================================================================[/!] [!] Error handling [/!] [!]=====================================================================[/!] [showif [sourceSpecified]!Yes]

Please specify the source file.

[/showif] [showif [sourceValid]!Yes]

Please choose either .gif or .jpg file.

[/showif] [!]=====================================================================[/!] [!] Everything is correct -- continue [/!] [!]=====================================================================[/!] [showif [sourceSpecified]=Yes] [showif [sourceValid]=Yes] [showif [TargetPathNameExt]!] [!]----- Form Variables:
[formvariables] [/formvariables]
IndexName
[index]
[name]
-----[/!] [formvariables] [showif [url][name][/url]^[url]"theFile"[/url]] [writefile file=[TargetPathNameExt]&secure=F][value][/writefile] [/showif] [/formvariables]

File Uploaded Successfully.

Uploaded Image:

[/showif] [/showif] [/showif] [replace db=admin/products.db&eqSKUdata=[sku]]weight=[SourceNameExt][/replace]