Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003

    Question Unanswered: Using extract() to assign variables to file uploads

    I would like to use the extract function of MySql to assign variables to images that are uploaded using the following PHP script:
    	foreach($_FILES as $file_name => $file_array){
    		print "path: ".$file_array['tmp_name']."<br>\n";
    		print "name: ".$file_array['name']."<br>\n";
    		print "type: ".$file_array['type']."<br>\n";
    		print "size: ".$file_array['size']."<br>\n";
    		if (is_uploaded_file($file_array['tmp_name'])) {
    				"$file_dir/$file_array[name]") or die ("Couldn't Copy");
    			print "File was moved!<br><br>";
    There will be three images submitted every time so I would like to create three variables that I can later on the same page.

    Any advice appreciated. Thanks in advance.

  2. #2
    Join Date
    Aug 2003
    Bologna - Italy
    The php script you posted simply puts the uploaded images in a directory specified in $file_dir variable.

    So, whatever is you want to do with them, you can pick them up from that dir, and do whatever you please.

    (I must admit that i haven't understood fully what's your problem, can you please be more specific?)
    The only failure is not trying to do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts