Rank: Advanced Member
Groups: Member
Joined: 3/18/2009(UTC) Posts: 46
Thanks: 3 times Was thanked: 1 time(s) in 1 post(s)
|
After our last post being busy just trying to extend some possibilities of Aurigma Up. One thing i encountered is that when several people are uploading, only the last is saved the rest are deleted or all files are mixed up. Deletion is not an option and the problem to store all files together is that the errors in sorting the photos afterwards (by us) is very large therefore i thought to have seperate folders per upload. What i thought was to let the user fillin his/her name and email address and to create a folder based on the name and date (date to prevent same names are used). I created an loginpage which direct to an php which creates the folder. All done using sessions. I think the session is broken when it goes to the basicdemo/index.php because it isn't using the folder created. For reference i included the whole folder. iphone.zip Hope you'll can have a look and help us out. Kind regards, Rob
|
1 user thanked Albertvdmeulen for this useful post.
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 7/13/2011(UTC) Posts: 286
Thanks: 6 times Was thanked: 31 time(s) in 31 post(s)
|
Hi Rob, As I can see in your upload.php file you create a varialbe for folder name, but you never use it. You should add this logic into your upload script: When saving uploaded file check whether the folder with the specified name exists (file_exists()), if not - create it (mkdir) and save the uploaded file into it. Please try it and let me know about the results. |
Best regards, Pauline Shirykalova Aurigma Technical Support
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 3/18/2009(UTC) Posts: 46
Thanks: 3 times Was thanked: 1 time(s) in 1 post(s)
|
Hi Pauline, Thanks for your reply. The folder is created that's not the problem (i checked this in the folder during upload) That's done in the file ../login/fotoupload.php which redirects to ../BasicDemo/index.php In ../BasicDemo/upload.php i'll open the session and retrieve the $foldernaam from the session Code:
if($_GET[sid])
{ //reclaim your session from the last page... if it's passed.
session_id($_GET[sid]);
}
session_start();
$foldernaam = $_SESSION['foldernaam'];
add this one to the uploadedFiles folder: Code://Do not forget about the slash in the end of the folder name.
$galleryPath = '../UploadedFiles/' . $foldernaam;
Could it be that i am retrieving the session in an incorrect way? Best regards, Rob
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hello Rob, We’ve checked your application on our testing iPad. In index.php file you should add ‘foldernaam’ field in cookies: Code: $params[] = 'cookies=' . session_name() . '=' . session_id() . ';' . 'foldernaam=' . $foldernaam;
Also, do not forget to include $foldernaam in the parameters of build_url bethod when it is called: Code: <a href="<?php echo build_url('upload.php', 'gallery.php', 'index.php', TRUE, $foldernaam); ?>" data-role="button">Upload files</a>
On the server side in upload.php file, you will need to get ‘foldernaam’ through $_COOKIE: Code: $foldernaam = $_COOKIE['foldernaam'];
We tested your application after these changes, and it worked okay for us. I attached corrected sample to this post. |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
1 user thanked Dmitry.Obukhov for this useful post.
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 3/18/2009(UTC) Posts: 46
Thanks: 3 times Was thanked: 1 time(s) in 1 post(s)
|
Dear Dmitry, As usual your are our saviour ! It works perfectly, only it wouldn't show the correct thumbs on the gallery page. so i added some parts in BasicDemo/gallery.php Code:
<?php
// Start de session
if($_GET[sid])
{ //reclaim your session from the last page... if it's passed.
session_id($_GET[sid]);
}
session_start();
$foldernaam = $_SESSION['foldernaam'];
?>
in the top of the file. and later on Code:
$galleryPath = '../UploadedFiles/' .$foldernaam;
and added an extra / before the thumbnailpath Code:
$thumb = $galleryPath."/Thumbnails/" . rawurlencode($xmlFile->getAttribute('source'));
Now the files are transfered to their designated folder and the gallery page is showing the thumbs. Thank you very much. With kind regards, Rob
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hi Rob, Oops :) I forgot to correct gallery.php page. Sorry for that :) |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
1 user thanked Dmitry.Obukhov for this useful post.
|
|
|
Rank: Newbie
Groups: Member
Joined: 7/10/2012(UTC) Posts: 4
Thanks: 3 times
|
I have adapted it for Android devices or so I thought but I can't seem to get the images to save. It creates the folder but won't upload the images in. The app returns an HTTP error of 4xx. Any Thoughts? Attached
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 7/13/2011(UTC) Posts: 286
Thanks: 6 times Was thanked: 31 time(s) in 31 post(s)
|
Hi Albert, I think the problem is in line 49 upload.php file. Please specify the full path to your SimpleImage.php file. When I first run the sample I was unable to upload any image - I got error 500. Once I specified the full path, the image was uploaded successfully. |
Best regards, Pauline Shirykalova Aurigma Technical Support
|
|
|
|
Rank: Newbie
Groups: Member
Joined: 7/10/2012(UTC) Posts: 4
Thanks: 3 times
|
Thanks for the quick reply, In my upload.php line 49 commented out. But my SimpleImage.php is here /BasicDemo/SimpleImage.php with my upload.php Code:
//create and save thumbnail
//include('SimpleImage.php');
$image = new SimpleImage();
$image->load($galleryPath."/".$sourceFileName);
$image->resize(250,300);
$image->save($galleryPath."/Thumbnails/".$sourceFileName);
Are you saying that I should change it to this? Code:
//create and save thumbnail
include('SimpleImage.php');
$image = new SimpleImage();
$image->load($galleryPath."/".$sourceFileName);
$image->resize(250,300);
$image->save($galleryPath."/Thumbnails/".$sourceFileName);
Edited by user Thursday, July 12, 2012 6:30:12 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 7/13/2011(UTC) Posts: 286
Thanks: 6 times Was thanked: 31 time(s) in 31 post(s)
|
Hi Albert, To be honest, with the commented line it works for me as well. However, I would suggest you to specify the full path to your SimpleImage.php file, like this: Code:include('http://polina.main.aurigma.com/iphone_corrected/BasicDemo/SimpleImage.php');
Please change the domain name and try again. |
Best regards, Pauline Shirykalova Aurigma Technical Support
|
|
|
|
Rank: Newbie
Groups: Member
Joined: 7/10/2012(UTC) Posts: 4
Thanks: 3 times
|
I tried that but I keep getting a 4xx error when I attempt to upload, there must be something wrong but I am unable to determine what.
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hello Ben, Could you please check your server-side logs? |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
1 user thanked Dmitry.Obukhov for this useful post.
|
|
|
Rank: Newbie
Groups: Member
Joined: 7/10/2012(UTC) Posts: 4
Thanks: 3 times
|
I found my errror! I was using SimpleImage.php in my code but I had renamed the actually file simpleimage.phpThank you guys so much for helping me out!
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Glad to know that you have fixed the problem :) If you have any additional questions please feel free to contact us. |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.