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