LC Server hidden fields with multipart/form-data fields

Kevin Stallibrass kevin at stallibrass.com
Tue Jul 28 10:26:06 EDT 2015


I have an lc server page with

 

put "test" into tRip

<form enctype="multipart/form-data" action="mypage.lc" method="post"
name="collect"

<font color=329bc4>Select file to upload:

<input type="hidden" name="rip" value="<?lc put tRip ?>

<input name="uploadedfile" type="file"

<input type="submit" value="Upload File" />

</form>

 

Then on mypage.lc I have

 

put $_Files[uploadedfile][name] into tFileName

put $_Files[uploadedfile][type] into tFileType

put $_Files[uploadedfile][size] into tFileSize

put $_Files[uploadedfile][filename] into tFilePath

 

put $_POST["rip"] into tRip 

 

My problem is that with enctype="multipart/form-data" in place, the file
uploads and I can access the $_Files data but not the $_POST

If I remove the enctype="multipart/form-data, there is no button to upload a
file but the $_POST data is now available.

 

I clearly cannot mix the $_Files & $_POST but cannot find anything online to
give me a clue on how to go about handling this.

I'm using livecode server 7.0.5 on a Ubuntu box but have tried it on on-rev
with the same effect

Any ideas?

 

Regards

 

Kevin Stallibrass

 

 




More information about the Use-livecode mailing list