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

Notification

Icon
Error

Options
Go to last post Go to first unread
pixelstitch  
#1 Posted : Monday, August 13, 2012 7:03:22 AM(UTC)
pixelstitch

Rank: Newbie

Groups: Member
Joined: 2/20/2012(UTC)
Posts: 5

G'day guys,

I'm really stoked that i came across your product. It's very cool...
Applause

I have a working servlet (that i hacked together quickly from some code i found on your website).
The basic functionality works for a single image/video but fails on multiple images/video.

The timeout on my tomcat server is set to 30 minutes, so there is plenty of time.

But with a multi file upload i get the message...

Upload faliure
Upload timeout. Please conatct the website support to resolve this problem.

The funny thing is, the multiple files that i'm upload are in the root of my test web app (where they should be at the moment).

this is my hacked code.
It's a start so please don't laugh...
Boo hoo!

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("doPost....");
HttpSession session = request.getSession();
String filePath = "";
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
ServletContext context = getServletContext();
System.out.println("context " + context);
String galleryPath = "";
String absGalleryPath;
absGalleryPath = context.getRealPath(galleryPath);
System.out.println("absGalleryPath " + absGalleryPath);

List listFileItems = null;
Hashtable fileItems = new Hashtable();
try {
listFileItems = upload.parseRequest(request);
System.out.println("listFileItems " + listFileItems.size());
for (int i = 0; i < listFileItems.size(); i++) {
FileItem fileItem = (FileItem) (listFileItems.get(i));
fileItems.put(fileItem.getFieldName(), fileItem);
}

} catch (FileUploadException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

//Get total number of uploaded files (all files are uploaded in a single package).
int fileCount = Integer.parseInt(((FileItem) fileItems.get("PackageFileCount")).getString());
System.out.println("fileCount " + fileCount);
//Iterate through uploaded data and save the original file, thumbnail, and description.
for (int i = 0; i < fileCount; i++) {
//Get source file and save it to disk.
FileItem sourceFileItem = (FileItem) fileItems.get("File0_" + Integer.toString(i));
String fileName = new File(sourceFileItem.getName()).getName();
File sourceFile = new File(absGalleryPath + File.separator + fileName);
try {
sourceFileItem.write(sourceFile);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}


enjoiMark

Also, where does the name aurigma come from?
pixelstitch  
#2 Posted : Monday, August 13, 2012 7:27:32 AM(UTC)
pixelstitch

Rank: Newbie

Groups: Member
Joined: 2/20/2012(UTC)
Posts: 5

hey guys,

Me again...
I forgot to mention that i'm running this through the mobile phone network in Australia.
Could that be my problem?

I would like to use this in an environment when a possible user could do the upload though a mobile network.
So, if this is the problem (i will go to a pub with wireless tomorrow and test from there), would it be possible to add an extra argument in the call to aurup...?

aurup:?uploadUrl=http://xxx.xxx.xxx.xxx/test/test&redirectUrl=http:// .... &mobile=yes...?

enjoiMark
Dmitry  
#3 Posted : Monday, August 13, 2012 7:36:48 AM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

This is a client-side timeout. Aurigma Up waits for a server response during specific amount of time. Since you are on slow mobile connection, it cannot get the response on time and fails. You can extend client timeout using the uploadTimeOut property: Aurigma Up API.
Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
pixelstitch  
#4 Posted : Monday, August 13, 2012 8:27:28 PM(UTC)
pixelstitch

Rank: Newbie

Groups: Member
Joined: 2/20/2012(UTC)
Posts: 5

Thank you so very much for this information.

Does the uploadTimeOut property: start at the start of the upload, and setting this to a large number will allow video files to be better handle by the app?

enjoiMark
Dmitry.Obukhov  
#5 Posted : Monday, August 13, 2012 9:44:29 PM(UTC)
Dmitry.Obukhov

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)
Mark,

uploadTimeOut is a value of time which Aurigma Up waits for a server response.
If a file is large, the server may handle it long time, e.g. save it to disk or do another action. In this case if a short uploadTimeOut is set, Aurigma Up will not get the response and fail. You should set such value of uploadTimeOut to be sure that any file will be handled by the server completely and Aurigma Up receives the response from the server.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
pixelstitch  
#6 Posted : Tuesday, August 14, 2012 3:42:53 PM(UTC)
pixelstitch

Rank: Newbie

Groups: Member
Joined: 2/20/2012(UTC)
Posts: 5

Hey Dmitry,

Thank you so very much for all your help.
It has been fantastic.
:-)

I almost have it working.
Just loosing my session information on the redirect.

Have a nice day.

enjoiMark
Dmitry.Obukhov  
#7 Posted : Tuesday, August 14, 2012 11:35:08 PM(UTC)
Dmitry.Obukhov

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)
Mark,

You should add sessions and authentication cookies through cookies property. Please use Code designer to set them.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
pixelstitch  
#8 Posted : Wednesday, August 15, 2012 12:12:11 AM(UTC)
pixelstitch

Rank: Newbie

Groups: Member
Joined: 2/20/2012(UTC)
Posts: 5

Hey Dmitry,

Thanks for the heads up, but i have hacked another workaround.
I only needed to pass one variable.
Have placed my code for others (i hope it puts a smile on someones face).

One quick question.
Are there any plans to be able to get into the voice over utility with the app...?
That would be very cool.

enjoiMark

<%
String currentDate = UtilitiesREstitch.getMeAdatePlease();

String path2 = "aurup:?uploadTimeOut=600&uploadUrl=http://xxx.xxx.xxx.xxx:8080/iUpload?currentDate=" + currentDate + "&amp;redirectUrl=http://xxx.xxx.xxx.xxx:8080/iMovieDetails.jsp?currentDate=" + currentDate + "&videoMode=source&licenseKey=0000-00040-0000-00000-00000-00000";
%>

<a style="font-size: 70px;" href="<%=path2 %>">Upload Images</a>
Dmitry.Obukhov  
#9 Posted : Wednesday, August 15, 2012 1:09:06 AM(UTC)
Dmitry.Obukhov

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)
Mark,

Thank you for your idea. We will consider about it.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
Users browsing this topic
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.