Re: How can I upload a file (using MooSock)?
I'm getting the same problem. The server returns Content Length: 0.
EDIT: It's definitely uploading the file. You can tell because the pause length between clicking "Upload" and receiving the server's message corresponds with the size of the file. The problem must be with the upload script then. Right? Where exactly does MooClick upload the file before it is moved by the upload script? I can't find the temporary files location.
EDIT2: Here's what the upload script looks like currently:
PHP Code:
<?php
$first_target_path = "images/";
$target_path = $first_target_path . basename( $_FILES['image']['name']);
$_FILES['image']['tmp_name'];
?>
and here's what the server returns:
Code:
HTTP/1.1 200 OK
Date: Fri, 30 May 2008 21:34:47 GMT
Server: Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8g DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
X-Powered-By: PHP/5.2.6
Content-Length: 0
Content-Type: text/html
Re: How can I upload a file (using MooSock)?
That's correct, you're not telling the server to output anything.
Try:
Quote:
echo $_FILES['image']['tmp_name'];
Re: How can I upload a file (using MooSock)?
Are you serious? That was the problem the whole time? :D That's funny and depressing at the same time.
I changed the file, but am out of town for the day. I'll be back around noon tomorrow. If you wanted to test it, you could.
Re: How can I upload a file (using MooSock)?
I tried it. It still doesn't work. Here's what the new upload.php looks like:
PHP Code:
<?php
$first_target_path = "/images/";
$target_path = $first_target_path . basename( $_FILES['image']['name']);
$_FILES['image']['tmp_name'];
echo "Temporary File: ".$_FILES['image']['tmp_name']." ... New File: ".$target_path;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target_path))
echo " ... Uploaded: Yes";
else
echo " ... Uploaded: No";
?>
What I get back is:
Code:
HTTP/1.1 200 OK
Date: Sun, 01 Jun 2008 20:36:10 GMT
Server: Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8g DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
X-Powered-By: PHP/5.2.6
Transfer-Encoding: chunked
Content-Type: text/html
56
Temporary File: /var/tmp/phprRg4mK ... New File: /images/admin~Level1 ... Uploaded: No
0
/var/tmp/php can be followed by any 6 characters. The rest is always the same.
Could you try it out? If it doesn't work, could you try it on your server? If it works on yours but not mine, I'll contact my web host.
EDIT: In the upload.php file, I changed
PHP Code:
$first_target_path = "images/";
to
PHP Code:
$first_target_path = "/images/";
Is that going to change anything?
Re: How can I upload a file (using MooSock)?
$_FILES['uploaded'] should be $_FILES['image'].
Re: How can I upload a file (using MooSock)?
OK, but it doesn't make any difference. It just changes what the server tells me. The file still doesn't upload. I fixed it, though. Could you try it out?
Re: How can I upload a file (using MooSock)?
Interesting. 10 minutes ago, it didn't work. Now, it does work. I don't know how that's possible considering I haven't touched anything at all, but I'm still outrageously happy right now. How long have we been troubleshooting this? 3 weeks? Wow. At last I can move my game along. :D
I think I said this before, but THANK YOU SO MUCH DYNASOFT! You have dedicated a lot of your time to helping some random person out, and that is amazing! Not many people would stick with solving someone else's problem for this long. THANKS!!!!!!!
Re: How can I upload a file (using MooSock)?
Wow. Right after it starts working, I lose an internet connection. I posted a "help me" thread on 5 different windows forums, and no one has figured it out yet. I'm not asking for help, just letting you know how much this stinks. Now all I can use is this mac. :(
Re: How can I upload a file (using MooSock)?
Re: How can I upload a file (using MooSock)?
Thanks for your understanding. :grin: