3.2.0

uploading jpeg with AW.HTTP.Request?

I am a newbie at web development, but I was able to get my local CSV files into a SQL database via a webservice, with the following code. (Thanks to ActiveWidgets) I also have a webservice that accepts a byte array and appends the jpeg image into a SQL table. My code all runs client side in a HTML file, just wondering if there was anyway to use ActiveWidgets to read the local jpeg file and then send the data to the webservice, which will then insert the image into SQL?

<script type="text/javascript" language="javascript">

// create external data model - CSV text table
var table = new AW.CSV.Table;
// set data URL - plain text comma-separated file
table.setURL("data_entity.csv");

table.response = function () {
var s = this.getResponseText();
//alert(s); // show received text
var req = new AW.HTTP.Request;
req.setURL("http://www.domain.com/webservice1.asmx/setEntity");
//req.setURL("webservicesql.asmx/setEntity");
req.setRequestMethod("POST");
req.setParameter("sessionId", "jcm123");
req.setParameter("entityData", s);
req.request();
}

// start asynchronous data retrieval
table.request();

</script>

jmoore
September 17,
Google for : " Reading binary files using Ajax "
September 17,
I was able to find and test an ASP page with a FileUpload control which posts to the webservice/SQL database. But I'm needing to upload a couple hundred 2K jpegs at a time. Having trouble finding anything that's automatic and doesn't require user intervention. But I'm guessing it may not exist for security reasons, so I was hoping a client side solution would get around security risk issues. Thanks for the reply.
jmoore
September 18,
You may want to try this java control, I use it to upload multiple files to my website. I believe it even does entire folders.

http://jumploader.com/

Erik
September 18,

This topic is archived.

See also:


Back to support forum