Copy link to clipboard
Copied
I have an insert form where the first field has a browse button attached to it for upload a file.
Here is the code
<form action="<?php echo $editFormAction; ?>" form enctype="multipart/form-data" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td width="113" align="right" nowrap="nowrap">PictureLocation:</td>
<td width="192"><input type="file" name="PictureLocation" value="" size="32" /></td>
<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />
Now, when I run it, this correctly allows me to browse for a file and puts the file path into the empty field for me, but when I click on the submit button, the $_POST variable is null so it can't write to the data base.
I have tried to set the $_POST value to the $_FILE value like this
$_POST['PictureLocation'] = $_FILES["PictureLocation"]["name"];
but unfortunately this command is ignored, it still thinks $_POST is null
Any way around this.
Why do you want to assign the value to the $_POST array? I presume this is because you're using an Insert Record server behavior that has something like this in the code:
GetSQLStringValue($_POST['PictureLocation'], "text")
The value doesn't need to be from the $_POST array. It can be whatever you like.
GetSQLStringValue($_FILES['PictureLocation']['name'], "text")
Copy link to clipboard
Copied
Why do you want to assign the value to the $_POST array? I presume this is because you're using an Insert Record server behavior that has something like this in the code:
GetSQLStringValue($_POST['PictureLocation'], "text")
The value doesn't need to be from the $_POST array. It can be whatever you like.
GetSQLStringValue($_FILES['PictureLocation']['name'], "text")
Copy link to clipboard
Copied
Thanks a lot david
I found the relevant SQL inserts and posted the value I wanted instead of the $POST.
Worked great.
Thanks
Find more inspiration, events, and resources on the new Adobe Community
Explore Now