FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Phonegap upload issue with PHP server
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Phonegap upload issue with PHP server [message #184761 is a reply to message #184759] Fri, 31 January 2014 13:51 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 1/31/2014 5:36 AM, Saikat Saha wrote:
>
> Hi Dennis,
>
> Thanks for the response.
>
> We have checked file upload using html tag type='input' and PHP server is able to capture the file but for phonegap code which is basically javascript is working fine for testserver so it proves that phonegap code is working absolutely fine there must be some issue with PHP code.
>
> <?php
>
> print_r($_FILES);
> $results = print_r($_FILES, 1) ;
> file_put_contents('mahi.txt', $results);
>
> if ($_FILES["file"]["error"] > 0) {
> file_put_contents('fail.txt', "fail");
> echo "Return Code: " . $_FILES["file"]["error"] . "";
> } else {
> file_put_contents('success.txt', "success");
> move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); //Save location
>
> }
> ?>
>

You said it works on the test server, so obviously the PHP code is correct.

What's the difference between your test and production servers? For
instance, on your production server, does ./upload exist and is it
writable by the web server user? What other differences might there be?

What do you get for messages in your mahi.txt and/or fail.txt files?

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: help with preg_match pattern
Next Topic: Writing double-prime to file?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 11:20:45 GMT 2024

Total time taken to generate the page: 0.04578 seconds