Posted by sheldonlg on 02/16/06 06:49
Ok, its been a while since I last wrote upload code and I am having a
problem. Here is what I have done:
1 - Two <input>s. One is type="file" and the other is type="submit".
The
file one gives a browse button that works and produces the correct name
of
the file I click --- C:\thisdir\thisfile.pdf
2 - I click on the submit button (called pdfSource). In my code I have
a
block with if isset($_POST['pdfSource']) amd it enters that block.
Here is where the fun begins.
In the previous code I had written, I simply had a
copy($_FILES['filename']['tmp_name'], "destination_on_server");
and it had worked.
Now, $_FILES['filename']['tmp_name'] and
$_FILES['filename']['tmp_name'] is
empty so it fails.
I then did:
$_FILES['filename']['tmp_name'] = $_POST['pdfSource'];
That didn't work because $_POST['pdfSource'] was
C:\\thisdir\\thisfile.pdf
so I did a little strtok and turned it into
C:\thisdir\thisfile.pdf
but that didn't work either so I changed it to
C:/thisdir/thisfile.pdf
and that didn't work.
Can anyone help?
Shelly
[Back to original message]
|