Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xhr.open('POST',(Ti.App.Properties.getString("apiaddress") + '/expense_service/add_expense'));
- //Try setting header 1.6.0
- xhr.setRequestHeader("Content-Type","multipart/form-data");
- xhr.setTimeout(0); //test apparently this will set it so it never times out?
- ///Test w/ destFile instead of theImage
- var resultFile = Titanium.Filesystem.createTempFile();
- var resultImageView = Titanium.UI.createImageView({
- image:theImage,
- top:0,
- left:0,
- height:360,
- width:240
- });
- resultFile.write(resultImageView.toBlob());
- xhr.send({
- media:resultFile,
- username:Titanium.App.Properties.getString("un"),
- password:Titanium.App.Properties.getString("pw"),
- amount:amtfield,
- date:dateField.value,
- category:parseInt(categoryID),
- merchant:merchantField.value,
- client:parseInt(clientID),
- payment_type_id:parseInt(payID),
- source:Titanium.Platform.name + Titanium.Platform.osname + Titanium.Platform.ostype + Titanium.Platform.version,
- location:geoLocation,
- mileage:mileageamt,
- notes:notesField.value,
- creation_time_in_milli_secs:uniqueid
- });
Add Comment
Please, Sign In to add comment