Thanx agin for your help.
The variable is a string. Example Code looks like this:
I basically used the SubmitFormToFtp example and called submit() via a http link instead of a submit button.
// Called when a connection has been made (or failed)
function onConnect(status)
{
if (status.success)
{
setStatus("Uploading image");
var image = $('#uploadImg_' + imageId);
var imgUrl = image.attr('src') + '/format/json';
//onImageFetch calls ftp.uploadText(imagedata, imagefilename)
$.get(imgUrl, '', onImageFetch);
//ftp.uploadText(submissionText, serverFileText.value
// onUploadText will be called when the text has been upload
}
else
{
setStatus("Could not connect.");
}
}
function onImageFetch(data, textStatus)
{
ftp.setTransferType('binary');
ftp.setConnectMode('passive');
ftp.setCharacterSet('UTF-8');
ftp.uploadText(base64_decode(data.file), data.filename);
}
The rest is the same code as in the example. I hope that helps you understand my problem and find a work around.
$.get(imgUrl, '', onImageFetch); uses JQuery for the ajax call. and ftp.uploadText(base64_decode(data.file), data.filename); uses another javascript function to decode the string.
Regards