php image uploader

2 views
Skip to first unread message

Javier Menendez

unread,
Mar 22, 2009, 2:49:18 AM3/22/09
to big5...@googlegroups.com
Hi there,$
I was just wondering if any of you guys have create a php script for uploading images from big5 to a server. I downloaded the script on the google group page and I tried but no luck. It uploads a corrupt image ( 4 kb ). It will great appriciated if some can let me know what I'm doing wrong or if someone have implemented the script already. I need to do it in php since we are using open source technologies therefore asp is out of the question.

many thanks in advance,
Javier.

Giraldo Rosales

unread,
Mar 22, 2009, 3:03:28 AM3/22/09
to big5...@googlegroups.com
You'll have to modify it to work correctly with Big5 but there is an example from LiquidGear under the Image link at:

-Giraldo
LiquidGear.net

Javier Menendez

unread,
Mar 22, 2009, 3:22:41 AM3/22/09
to big5...@googlegroups.com
oh ok thanks giraldo but the links dont seem to work.

this is the script that I'm using :

<?php

$fp= stripslashes($_POST['data']); //4 OK
file_put_contents("temp/temp.jpg",$fp,FILE_BINARY);

?>


folder and script have 755 permissions.

thank you.

Giraldo Rosales

unread,
Mar 22, 2009, 11:43:40 AM3/22/09
to big5...@googlegroups.com

The file name is uploaded as the variable, data, on Big5. So the PHP would be...


<?

$uploadDir = 'upload/';

move_uploaded_file($_FILES['data']['tmp_name'], $uploadDir . $_FILES['data']['name']);

?>

beautiful_life

unread,
May 21, 2009, 1:40:06 AM5/21/09
to Big Five Safari iPhone Apps
Hi Giraldo,

I did try both ways:

<?

$uploadDir = 'upload/';

move_uploaded_file($_FILES['data']['tmp_name'], $uploadDir .
$_FILES['data']['name']);

?>
and
<?php

$fp= stripslashes($_POST['data']); //4 OK
file_put_contents("temp/temp.jpg",$fp,FILE_BINARY);

?>

but they didn't work. I also tried to catch $_POST['data'] but it was
empty. Do you have full php sample file or any idea? Please help me.
But it worked if i send picture to http://www.big5apps.com/upload?uid=.

cheers,
Kien

On Mar 23, 12:43 am, Giraldo Rosales <nitr...@gmail.com> wrote:
> The file name is uploaded as the variable, data, on Big5. So the PHP would
> be...
>
> <?
>
> $uploadDir = 'upload/';
>
> move_uploaded_file($_FILES['data']['tmp_name'], $uploadDir .
> $_FILES['data']['name']);
>
> ?>
>
> On Sun, Mar 22, 2009 at 2:22 AM, Javier Menendez <jfm...@gmail.com> wrote:
> > oh ok thanks giraldo but the links dont seem to work.
>
> > this is the script that I'm using :
>
> > <?php
>
> > $fp= stripslashes($_POST['data']); //4 OK
> > file_put_contents("temp/temp.jpg",$fp,FILE_BINARY);
>
> > ?>
>
> > folder and script have 755 permissions.
>
> > thank you.
>

Giraldo Rosales

unread,
May 21, 2009, 9:23:40 AM5/21/09
to big5...@googlegroups.com
Look att he very bottom of this page:
http://www.liquidgear.net/iphonedocs/image

There is an example of a php script and the html form that goes with it. Their should really be a tutorial section added. Watch the variable names to make sure everything is sent properly.

-G
LiquidGear.net
Reply all
Reply to author
Forward
0 new messages