Sending variables to file upload page


i'm working on app users can upload logo company. i'm able create folder logo based on company name ahead of filereference.browse() function, there way send name of newly created directory along filedata page upload? can't guarantee people name image different else, , while coldfusion create unique name if needed, flex doesn't know happened potentially storing incorrect filename unless can save image in company's directory.

here code - simple


flex
switch (accountchoice.selectedvalue) {
case "club / venue":
var fileupload:string = '/hr/imageupload/clublogo.cfm';
break;
case "band / artist":
var fileupload:string = '/hr/imageupload/bandlogo.cfm';
break;
case "partner / advertiser":
var fileupload:string = '/hr/imageupload/adlogo.cfm';
break;
}

filename = fileref.name;
clublogo.text = filename;
var uploadcfm:urlrequest = new urlrequest();
uploadcfm.url = fileupload;
fileref.upload(uploadcfm);

coldfusion
<cfoutput>
<cffile action="upload" filefield="filedata" destination="#expandpath('./clubs')#" nameconflict="makeunique"/>
</cfoutput>


i'd pass variable in directory, , add destination attribute above

any ideas/help appreciated

ethan

not sure if understand you're trying do, if wanted send additional information upload believe can use urlvariables.

for example, you'd create urlvariable directory name you'd want send along:

var urlvar:urlvariables = new urlvariables;
urlvar.companydirectory = dir;

then append urlrequest

var uploadcfm:urlrequest = new urlrequest("upload.cfm");
uploadcfm.data = urlvar;

from here it's matter of accessing "companydirectory" variable passed $_post or $_get.


More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums