[text]page_title=Upload File[/text] [text]helpid=upload_file[/text] [include banner.inc] [!]=====================================================================[/!] [!] Process forms [/!] [!]=====================================================================[/!] [formvariables] [showif [url][name][/url]^[url]"graphicpurpose"[/url]] [text]graphicpurpose=[value][/text] [/showif] [showif [url][name][/url]^[url]"sku_number"[/url]] [text]sku=[value][/text] [/showif] [showif [url][name][/url]^[url]"callerurl"[/url]] [text]callerurl=[value][/text] [/showif] [!]=====================================================================[/!] [!] Get target path info [/!] [!]=====================================================================[/!] [Showif [graphicpurpose]=Layout] [Text]TargetPath=[lookup db=prefs.db&value=LAYOUT_GRAPHIC_PATH&lookInField=PREF&returnField=value][/Text] [/Showif] [Showif [graphicpurpose]=Product] [Text]TargetPath=[lookup db=prefs.db&value=PRODUCT_GRAPHIC_PATH&lookInField=PREF&returnField=value][/Text] [/Showif] [!]----- 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] [Showif [sku]=[Raw][sku][/Raw]]
[/Showif] [Showif [sku]![Raw][sku][/Raw]]
[/Showif]