FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[urgent] File upload once again
#5
Thanks for the reply!

I have confirmed that the file was uploaded (i have shell access on that machine).

I now use kind of a workaround for that file problem...

For copying the uploaded files into the target upload directory, i use something like in the older thread i linked to in my first post:

Code:
// Define the upload location
$target_path = "/somewhere/";

// Create the file name with path
$filename = basename( $_FILES['YOUR FILE FIELD NAME']['name']);

// Try to move the file from the temporay directory to the defined.
if(move_uploaded_file($_FILES['YOUR FILE FIELD NAME']['tmp_name'], $target_path . $filename )) {
echo "The file ". basename( $_FILES['YOUR FILE FIELD NAME']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
}

For displaying i store the filenames into some new field inside of the session (kind of abusing it).

Code:
$_SESSION[form_tools_form]['uploadname1] = $filename;

I can then access $fields['uploadname1'] on the next page (after $fields = ft_api_init_form_page();

Like this it works for me.

(Jun 3rd, 2011, 1:33 AM)Ben Wrote:
Quote:Is accessing it by $fields['uploadfield'] correct?

Ah, no! I don't think so... if that will contain anything, it will contain the filename. (I'll have to look into that).

Could you confirm via an FTP client that the file was, in fact uploaded?

- Ben

Reply


Messages In This Thread
[urgent] File upload once again - by asgaroth - May 30th, 2011, 4:47 AM
RE: [urgent] File upload once again - by Ben - May 30th, 2011, 4:51 AM
RE: [urgent] File upload once again - by asgaroth - May 30th, 2011, 8:43 AM
RE: [urgent] File upload once again - by Ben - Jun 3rd, 2011, 1:33 AM
RE: [urgent] File upload once again - by asgaroth - Jun 3rd, 2011, 5:18 AM
RE: [urgent] File upload once again - by Ben - Jun 5th, 2011, 7:43 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)