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

Notification

Icon
Error

Options
Go to last post Go to first unread
Adnarim  
#1 Posted : Monday, June 11, 2012 1:11:23 PM(UTC)
Adnarim

Rank: Newbie

Groups: Member
Joined: 6/11/2012(UTC)
Posts: 3

Hi,

I started with the Getting Started (http://www.aurigma.com/mobile/getting-started.aspx#tabs) and got stuck at step 3.

However, it uploads, but i want the data back so i can save the filename in the database.

I noticed that the $_POST['PackageFileCount'] doesn't return anything. The $_POST is totally empty, which makes it not run the for loop.

Edited by user Tuesday, June 12, 2012 1:18:52 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#2 Posted : Tuesday, June 12, 2012 11:56:52 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 Miranda,

I prepared a sample application with Aurigma Up. The Step 3 of "Getting started" section provides you with an example of server-side code which handles uploaded files. I used the same code in my sample application (upload.php) file. I attached the ZIP archive with the application for your reference. Please download and try it. Do not forget tho set correct uploadUrl, redirectUrl, and returnUrl in the index.php file.

If you have any questions please let me know.

File Attachment(s):
AurigmaUp_php.zip (1kb) downloaded 21 time(s).
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

Adnarim  
#3 Posted : Thursday, June 14, 2012 11:03:33 AM(UTC)
Adnarim

Rank: Newbie

Groups: Member
Joined: 6/11/2012(UTC)
Posts: 3

Hello Dmitry,

I've got the same code like you gave me, but i want to get the name of the file back after redirected back to the site so I can store it in the database.

So it's still not working :(

Photos-4-all.com  
#4 Posted : Thursday, June 14, 2012 12:54:36 PM(UTC)
Photos-4-all.com

Rank: Member

Groups: Member
Joined: 5/3/2012(UTC)
Posts: 14

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Hi Adnarim,

Thought I could help. I have created a little example which stores the filename in a folder. I have tested it on my server and it works. I have attached the file to this post.

You need to:

Update index.php with your url details.

Update config.php with you database details.

Update mysql_query() in upload.php with the correct table & column name.

Hope this works for you.

Regards,

Mark Marshall

Edited by user Thursday, June 14, 2012 12:56:02 PM(UTC)  | Reason: Not specified

File Attachment(s):
AurigmaUp - Help.zip (2kb) downloaded 14 time(s).
thanks 1 user thanked Photos-4-all.com for this useful post.
Dmitry.Obukhov on 6/14/2012(UTC)
Dmitry.Obukhov  
#5 Posted : Thursday, June 14, 2012 6:57:39 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 Mark,

Thank you for your assistant :) I appreciate it.

Hello Miranda,

Could you please test Mark's sample? Then let us know about your result.

Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

Adnarim  
#6 Posted : Monday, June 18, 2012 7:08:57 AM(UTC)
Adnarim

Rank: Newbie

Groups: Member
Joined: 6/11/2012(UTC)
Posts: 3

Hello,

I've tried the code, and i get a name in the database, so i'm going to rebuild my code in these files and give it a try.

Thanks for helping, and i'll let you know if i've been able to rewrite it to my own code ;)

/*update*/

I've been able to update my code, but i have another field, called productname, and i want to take this along the proces so the image url can be stored with the product name.

Only thing i can think of to make this work right now is to first upload the image, and then on the redirect page place a form to fill in the name.

But there should be an easier way, but i don't know how.

Edited by user Monday, June 18, 2012 8:19:03 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#7 Posted : Monday, June 18, 2012 7:45: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)
Hello Miranda,

Glad to know about your success :) You can submit another field along with files using fields parameter. Please see the code snippet below. Here is a field you need to send:

Code:

<form name="uploadform" action="" method="post">
  <input type="submit" name="submit" value="Upload"/>
  <input type="text" name="productName" value="Apples"/>
</form>

This code builds Aurigma Up link:

Code:

<?php
if($_POST['submit'] == "Upload"){
	//URL details
	$uploadUrl = 'uploadUrl=http://obukhov-pc.main.aurigma.com/AurigmaUp/upload.php&';
	$redirectUrl = 'redirectUrl=//obukhov-pc.main.aurigma.com/AurigmaUp/redirect.php&';
	$redirectDelay = 'redirectDelay=0&';
	$licenseKey = 'licenseKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXXX&';
	$fields = 'fields=product=' . $_POST['productName'];

	//Load Aurigma Up App
	header("Location: aurup:?" . $uploadUrl . $redirectUrl . $redirectDelay . $licenseKey . $fields);
}
?> 

I attached corrected index.php file. Please download and replace it in your project. If you have any question or problems please feel free to let me know.

File Attachment(s):
index.zip (2kb) downloaded 12 time(s).
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

Users browsing this topic
Guest
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.