i have already posted this on the newbie forum so sorry to repeat it but i need to try and get this problem fixed asap for a friend of mine!
Hello all,
i am having a strange problem with file uploads but cannot figure out why it is not working. basically, the problem occurs when uploading word documents. the files are getting moved to the correct location on the server but the size of the file is much smaller and when i try and open it it is not a complete file. so i assume that the whole file isn't getting transfered (original file = 30k, uploaded file = 637bytes). but this doesn't happen with text or html files. they are transfered nicely and can then be viewed from the server within a web browser.
so, my question is.....does anyone know why the whole file wouldn't be copied when uploading word documents and if so how to rectify it?
here is the code for the upload (but i know this works as it works for text and html files:
<?php
$filedir = "/websites/1102/woodwo8d/public_html/files";
$userfile_name = $_FILES['userfile']['name'];
$location = "$filedir/$userfile_name";
move_uploaded_file($userfile_tmp, $location);
?>
i cannot fathom this out and would appreciate any help! i cannot understand how some file types work and then the word documents don't!
i have since figured out that although it appears that the text and html files are transfered ok and are viewable in a web browser it would seem that they too are not being transfered fully. the files are getting cut off at around 630bytes (eg. a text file i uploaded was originally 1.42k and after upload is 629bytes and a html file was originally 51.8k and after upload is 649bytes!). so, it would seem that somewhere along the there is a limit or something but upload_max_filesize in php.ini is set to 2M!!
where else could a limit be set?
thanks,
tom.