Pages: [1]
  Print  
Author Topic: Upload and form  (Read 5976 times)
0 Members and 1 Guest are viewing this topic.
khusal
Newbie
*
Posts: 2


« on: 14 August , 2008, 09:18:58 »

Hello,

I am trying to create a mobile application that uploads a video or an image to a server. An xml containing the details of the media needs to be uploaded together to update the xml database on the server. The script on the server is called using a form and the form tag should contain the following attributes:

<form action="http://dev.hrjohnson.co.uk/cgi-bin/khushal/upload.cgi" method="post" enctype="multipart/form-data">

Is there an equivalent of the following for kunerilite upload plugin?

form action="http://dev.hrjohnson.co.uk/cgi-bin/khushal/upload.cgi" method="POST" ENCTYPE="multipart/form-data"><input type="FILE" name="FILE1" <input type="FILE" name="FILE2"></form>

Khusal
Logged
KL Admin
Moderator
Sr. Member
*****
Posts: 313


« Reply #1 on: 15 August , 2008, 01:13:35 »

Hi Khusal,

You are doing pretty interesting stuff and it should be possible,
please take a look at:
http://wiki.kunerilite.net/index.php?title=Upload/Download_plugin#Upload

This command just uploads the image.jpg
(you can also embed custom variables (in bold) in the request):

loadVariables("http://127.0.0.1:1001/Basic/uldl?klCommand=upload&klTrId=1234&klUrl=
http://dev.hrjohnson.co.uk/cgi-bin/khushal/upload.cgi?input type=file&name=file1&klFile=image.jpeg&klType=image/jpeg", "" );

(kl* variables are translated by KuneriLite and are not sent to server)

I hope this is something you can start with.

Wishes,
Jukka
Logged
chilledoutjohn1983
Newbie
*
Posts: 8


« Reply #2 on: 19 August , 2008, 04:13:49 »

I am trying to do something quite similar to this but i need to access returned variables (load variables), does kuneri allow this?

loadVariables("http://127.0.0.1:1001/Basic/uldl?klCommand=upload&klTrId=1234&klUrl=http://server.com/receive_data.php?var1="+_root.var1+"&var2="+_root.var2+" &klFile=c:\\data\\Others\\MyPictureBack.jpg &klType=image/jpeg", "", "POST" );

a variable called "pin" is returned by the php. Can i access it this way or can you suggest something else?

cheers
Logged
KL Admin
Moderator
Sr. Member
*****
Posts: 313


« Reply #3 on: 19 August , 2008, 05:16:55 »

No, at least not right now.

You can use separate command klCommand=loadVariables,
it will return variables from server.

Is it possible that you first initiate upload and after upload is finished, call above command?
Logged
chilledoutjohn1983
Newbie
*
Posts: 8


« Reply #4 on: 19 August , 2008, 08:33:07 »

Thanks for the fast responce

Is there a limit to the amount of data that can be included in the uploaded variables? I'm trying o upload allot of data but an error -15 is returned.

Cheers
Logged
KL Admin
Moderator
Sr. Member
*****
Posts: 313


« Reply #5 on: 20 August , 2008, 00:31:47 »

There is no limitation in upload amount, this might be else problem. We can check it out:
If you don't mind, can you copy/paste some example URL here or send me priv. message?

Cheers,
Jukka
Logged
chilledoutjohn1983
Newbie
*
Posts: 8


« Reply #6 on: 20 August , 2008, 05:13:40 »

heres what i'm trying to send. when i select an access point after a few seconds an error -15 is returned.

loadVariables("http://127.0.0.1:1001/Basic/uldl?klCommand=upload&klTrId=1234&klUrl=http://server/receive_data.php?CIx="+_root.CIx+"&CIy="+_root.CIy+"&CIsvg="+"10%2C10%2010%2C37%2E6%2015%2E635%2C37%2E6%2010%2C62%2E6%2026%2E905%2C37%2E6%2066%2E35%2C37%2E6%2066%2E35%2C10%2010%2C10%20"+"&CIcaption="+_root.CIcaption+"&CIpin="+_root.rand+" &klFile=c:\\data\\Others\\app\\MyPictureBack.jpg &klType=image/jpeg", "", "POST" );

this is the actual data thats trying to be sent with the variables replaced with their actual values:

loadVariables("http://127.0.0.1:1001/Basic/uldl?klCommand=upload&klTrId=1234&klUrl=http://server/receive_data.php?CIx="+10+"&CIy="+10+"&CIsvg="+"10%2C10%2010%2C37%2E6%2015%2E635%2C37%2E6%2010%2C62%2E6%2026%2E905%2C37%2E6%2066%2E35%2C37%2E6%2066%2E35%2C10%2010%2C10%20"+"&CIcaption="+"this is some text"+"&CIpin="+1232456789+" &klFile=c:\\data\\Others\\app\\MyPictureBack.jpg &klType=image/jpeg", "", "POST" );

cheers
Logged
Pages: [1]
  Print  
 
Jump to: