Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Albertvdmeulen  
#1 Posted : Saturday, December 3, 2011 8:44:44 AM(UTC)
Albertvdmeulen

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

thanks 1 user thanked Albertvdmeulen for this useful post.
ocbenji on 7/11/2012(UTC)
p.shirykalova  
#2 Posted : Monday, December 5, 2011 1:53:43 AM(UTC)
p.shirykalova

Rank: Advanced Member

Groups: Administration
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

Albertvdmeulen  
#3 Posted : Monday, December 5, 2011 6:23:27 AM(UTC)
Albertvdmeulen

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

Dmitry.Obukhov  
#4 Posted : Monday, December 5, 2011 9:28:42 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Administration
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.

File Attachment(s):
iphone_corrected.zip (833kb) downloaded 47 time(s).
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

thanks 1 user thanked Dmitry.Obukhov for this useful post.
Albertvdmeulen on 12/7/2011(UTC)
Albertvdmeulen  
#5 Posted : Wednesday, December 7, 2011 6:29:36 AM(UTC)
Albertvdmeulen

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 Applause !

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

Dmitry.Obukhov  
#6 Posted : Wednesday, December 7, 2011 6:13:53 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Administration
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.

thanks 1 user thanked Dmitry.Obukhov for this useful post.
ocbenji on 7/11/2012(UTC)
ocbenji  
#7 Posted : Wednesday, July 11, 2012 4:25:01 PM(UTC)
ocbenji

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

File Attachment(s):
smartphone_corrected.zip (839kb) downloaded 14 time(s).
p.shirykalova  
#8 Posted : Thursday, July 12, 2012 12:38:27 AM(UTC)
p.shirykalova

Rank: Advanced Member

Groups: Administration
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

ocbenji  
#9 Posted : Thursday, July 12, 2012 6:09:27 AM(UTC)
ocbenji

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

p.shirykalova  
#10 Posted : Thursday, July 12, 2012 6:23:00 PM(UTC)
p.shirykalova

Rank: Advanced Member

Groups: Administration
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

ocbenji  
#11 Posted : Saturday, July 14, 2012 8:02:12 PM(UTC)
ocbenji

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.
Dmitry.Obukhov  
#12 Posted : Monday, July 16, 2012 1:20:16 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Administration
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.

thanks 1 user thanked Dmitry.Obukhov for this useful post.
ocbenji on 7/16/2012(UTC)
ocbenji  
#13 Posted : Monday, July 16, 2012 3:51:00 AM(UTC)
ocbenji

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.php

Thank you guys so much for helping me out!

Dmitry.Obukhov  
#14 Posted : Monday, July 16, 2012 7:14:08 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Administration
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.

Users browsing this topic
Guest
Similar Topics
Per user different upload folder on server (Aurigma Up (iOS/Android))
by Marvin 11/28/2012 5:19:37 AM(UTC)
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.