[eluser]Unknown[/eluser]
Hi all i am working on a application using CI,PICNIK what i am doing is editing files using picnik then upload them to my server and need to use some URL having query strings
http://MYURL/uploads/uploadEditedImage/0...m/file.jpg
but when i hit this url i get
Object not found!
i am using the CI standard Urls in my application but picnik sends the Url in above format how can we handle this in CI
1.)I dont want to use normal Urls
2.)We cant change the Url formats of picnik as they are auto generated
i an attaching my code for View and controller
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<link rel="stylesheet" href="<?php echo base_url(); ?>/js/appjs/picnik/picnikbox_2_0.css" media="screen" type="text/css" />
[removed][removed]
[removed]
PicnikBox.SetPicnikMargins(10,10,10,10);
[removed]
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>styles/style.css">
<TITLE> Edit </TITLE>
</HEAD>
<BODY bgcolor="#B5B8A0">
<table cellspacing="0" cellpadding="5" align="center">
<tr>
<td>
<img width="100" height="100" src="<?php echo($_GET['path']);?>"></img>
</td>
</tr>
<tr>
<td>
<form action="http://www.picnik.com/service/" method="post" enctype="multipart/form-data">
<input type="hidden" name="_apikey" value="5dd9d9c14750eb30c9491f2c516f39b4">
<input type="hidden" name="_import" value="image"/>
<input type="hidden" name="image" value="<?php echo($_GET['path']);?>"/>
<input type="hidden" name="_exclude" value="out"/>
<input type="hidden" name="_export_method" value="post"/>
<input type="hidden" name="_export_field" value="file"/>
<input type="hidden" name="_export_agent" value="browser"/>
<input type="hidden" name="_export" value="http://MYURL/uploads/uploadEditedImage/<?php echo($_GET['filename']);?>"/>
<input type="hidden" name="_export_title" value="Save Photo"/>
<input type="hidden" name="_close_target" value="http://www.google.com"/>
<input type="submit" value="Edit" class="greyButtonDark"/>
</td>
</tr>
</form>
</table>
</BODY>
</HTML>
And here is my controller
Code:
function uploadEditedImage($filename = '')
{
if (!isset($_GET['file'])) {[b]//This file is send from Picnic as a query string[/b]
echo "Sorry, no image URL was sent.";
exit();
}
$image_url = $_GET['file'];[b]//This file is send from Picnic as a query string[/b]
if (0 !== stripos( $image_url, "http://www.picnik.com")) {
echo "Sorry, the image URL doesn't seem right.";
exit();
}
$image_data = file_get_contents( $image_url );
if (FALSE === $image_data) {
echo "Sorry, the image download failed.";
exit();
}
$image_filename = $filename;
file_put_contents( $image_filename, $image_data );
$this->load->view('upload_success', $imagesData);
}