[FX.php List] Help with uploading files into a container field

David Ness dness at bondedbuilders.com
Fri Nov 10 12:40:25 MST 2006


Okay, I'll give this a go...
 
First, create a upload form using code similar to this:
 
<form name="SubmitFileForm"
         enctype="multipart/form-data"
         action="processsubmissionpage.php"
         method="POST">
        <input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
        <input size="30" name="userfile" type="file" />
        <input type="submit"
          name="batchSubmit"
          value="Send File"
          onclick="return checkFilename()" />
       </form>
 
I use a javascript routine to present a message to confirm the
submission and to prevent multiple clicking of the submit button:
 
<script language="javascript">
 
var submitOnlyOnce = true;
 
function checkFilename() {
 if( document.SubmitFileForm.userfile.value == "" ) {
  alert('Please select a file to be uploaded for processing')
  return false
 } else {
  if( submitOnlyOnce ) {
   submitOnlyOnce = false
   // the following was created to allow the user to cancel the
following
   // dialog and reset the submitOnlyOnce flag
    if( confirm('You have selected to submit your
resume.\n\nContinue?')) {
    return true
   } else {
    submitOnlyOnce = true
    return false
   }
  } else { 
   alert('Only select Submit once. Your previous submit\nhas already
been accepted and is being processed.\n\nYou will be forwarded to the
next screen momentarily.')
   return false
  }
 }
}
</script>
 
 
Then, on your processing page, you want to move the file from the
default upload location (check your php.ini file) using somehting like
this:
 
      
move_uploaded_file(
$_FILES['userfile']['tmp_name'],"pathtowhereyouwanttoputthefile".$nameyo
uwanttogivethefile);
 
Now you will need to run a script in FileMaker to import the file by
filename you assigned from the path you assigned into your container
field.
 
This is just an outline of the process. Check the online php manual for
more info on processing uploaded files.
 
Hope this helps.
 
--
David Ness,
Database Systems Programmer
 
Bonded Builders Warranty Group
1500 Kings Highway
Port Charlotte, FL 33980
800.749.0381 x3123 (National Toll Free)
941.255.3274 x3123 (Local)
 
 

________________________________

From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of
FHASELTINE at aol.com
Sent: Friday, November 10, 2006 9:39 AM
To: fx.php_list at mail.iviking.org
Subject: [FX.php List] Help with uploading files into a container field


I have a data base that is accessed with FX and the forms work well.
    I need to start allowing people to upload their Resume File.    
    I would like them to upload their resume into a container field that
exists
    for that purpose in their record.
    This question is how do I start the coding in my "form" and in the
"form
    processing page".   If one of you would kindly point me to the right
set of
    instructions, I will be off and running. Thanks
    Florence Haseltine
    2181 Jamieson Ave Apt 1606
    Alexandria, VA 22314
    240 476 7837 Mobile
    301-793-0372 Work Mobile
    703 566 8390 Home
    email fhaseltine at aol.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20061110/8ed027e0/attachment.html


More information about the FX.php_List mailing list