<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Accessing Mime Attachments in Web Scripts in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191863#M144993</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OK, yes, this is where I'd already got up to.&amp;nbsp; What I'm trying to do is find out how that "content" variable can be populated from a straight mime attachment in the HTTP POST.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'm looking for is something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var content = request.getMimeAttachment()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But of course, there isn't a "request" object in scope, which brings me to the purpose of this post &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&amp;nbsp; The content is /not/ already in the repository, it's coming out of the ether, and into the repo via this very raw HTTP POST with a binary mime attachment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Richard&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Oct 2008 12:35:28 GMT</pubDate>
    <dc:creator>r1ch4rd</dc:creator>
    <dc:date>2008-10-08T12:35:28Z</dc:date>
    <item>
      <title>Accessing Mime Attachments in Web Scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191859#M144989</link>
      <description>Hi Folks,How can I access Mime Attachments when running at HTTP POST or PUT operation on a web script which I am writing to provide a RESTful service to my Alfresco repository?I am writing a Share Dashlet which needs to deliver generated content (not from a file upload form) to the repository, but I</description>
      <pubDate>Wed, 08 Oct 2008 10:22:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191859#M144989</guid>
      <dc:creator>r1ch4rd</dc:creator>
      <dc:date>2008-10-08T10:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Mime Attachments in Web Scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191860#M144990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sounds like a confusing design - if you're generating the content, why can't you send that in an HTTP POST and write it to a file on the server?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 10:49:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191860#M144990</guid>
      <dc:creator>mikeh</dc:creator>
      <dc:date>2008-10-08T10:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Mime Attachments in Web Scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191861#M144991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, the content is being generated elsewhere, and being given to the dashlet upon request.&amp;nbsp; The Dashlet's job is to offer the user the opportunity to store in the repository this externally generated content.&amp;nbsp; Additionally, this is only the tip of the iceberg; I have general requirements to support a RESTful service on my Alfresco repository which will deposit content via HTTP POST, and will contain important information regarding the deposit in the HTTP headers, and which won't have any form data associated with it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Either way, I don't see what you mean by sending it by HTTP POST and writing it to a file on the server, sorry.&amp;nbsp; Do you mean cache the generated content in some holding space, outside of the repository?&amp;nbsp; That seems like an unnecessary additional step.&amp;nbsp; The problem I'm having with my web scripts is that I don't see how to handle an HTTP POST which /isn't/ a form upload (which is the only practical example of a POST here: &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/Web_Scripts_Examples#File_Upload" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Web_Scripts_Examples#File_Upload&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Richard&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 11:12:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191861#M144991</guid>
      <dc:creator>r1ch4rd</dc:creator>
      <dc:date>2008-10-08T11:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Mime Attachments in Web Scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191862#M144992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Well, the content is being generated elsewhere, and being given to the dashlet upon request.&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;So you've got some binary data in your hand..?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The pertinent part of the upload script is&lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;upload.properties.content.write(content)&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;Now &lt;/SPAN&gt;&lt;EM&gt;content&lt;/EM&gt;&lt;SPAN&gt; could come from anywhere - it so happens that to handle a browser-sourced file upload, you get this from parsing multipart-form data. There's no reason why &lt;/SPAN&gt;&lt;EM&gt;content&lt;/EM&gt;&lt;SPAN&gt; couldn't come from HTTP POST variable(s), or another node already in the repo.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 11:51:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191862#M144992</guid>
      <dc:creator>mikeh</dc:creator>
      <dc:date>2008-10-08T11:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Mime Attachments in Web Scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191863#M144993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OK, yes, this is where I'd already got up to.&amp;nbsp; What I'm trying to do is find out how that "content" variable can be populated from a straight mime attachment in the HTTP POST.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'm looking for is something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var content = request.getMimeAttachment()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But of course, there isn't a "request" object in scope, which brings me to the purpose of this post &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&amp;nbsp; The content is /not/ already in the repository, it's coming out of the ether, and into the repo via this very raw HTTP POST with a binary mime attachment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Richard&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 12:35:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191863#M144993</guid>
      <dc:creator>r1ch4rd</dc:creator>
      <dc:date>2008-10-08T12:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Mime Attachments in Web Scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191864#M144994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah right, ok. Your options would seem to be either -as you suspected- hand-build the multipart/form request which the browser would normally do for you (it shouldn't be too tricky), or encode the binary data into a POST variable and access it via args as if it was a browser-submitted form request. There is one final option, which is to write your own format reader for the webscript runtime. You could use &lt;/SPAN&gt;&lt;EM&gt;org.alfresco.web.scripts.servlet.FormDataReader&lt;/EM&gt;&lt;SPAN&gt; as a starting point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 14:00:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191864#M144994</guid>
      <dc:creator>mikeh</dc:creator>
      <dc:date>2008-10-08T14:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Mime Attachments in Web Scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191865#M144995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Great, thanks very much, that's very helpful.&amp;nbsp; I'll try the quick method of putting the base64 encoded content in as a POST variable, although I have no idea how that scales &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&amp;nbsp; Otherwise I'll move onto the other two methods.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't suppose (I notice your "Alfresco Engineer" status) that a good feature request would be for more complete HTTP handling to the web scripts, is it?&amp;nbsp; I can't see how as you would write good RESTful web services using the web scripts without these facilities.&amp;nbsp; For example, a number of standards use header fields or even extensions as part of the protocol, which are currently inaccessible to us here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All the best,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Richard&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 14:23:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191865#M144995</guid>
      <dc:creator>r1ch4rd</dc:creator>
      <dc:date>2008-10-08T14:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Mime Attachments in Web Scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191866#M144996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's an area we've been thinking about - and have recently done some refactoring around reading of the request body. The issue is that we don't want to do any unnecessary parsing, processing, or caching of the request body until it's certain (a) what format it's in and (b) whether it's even required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We currently process multipart/form, form POST, JSON and CMIS (ATOM) bodies depending on the webscript extension, using different readers. For your case where the file's content is in the body, it makes sense to create a new reader - e.g tied to ".file.js" webscript extensions - which would present the request body's content as a content stream suitable for writing to a file to the JavaScript runtime.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your other request is for access to arbitrary request headers? This is probably something we can look at as an improvement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In either case, please raise enhancement issues in &lt;/SPAN&gt;&lt;A href="https://issues.alfresco.com/" rel="nofollow noopener noreferrer"&gt;JIRA&lt;/A&gt;&lt;SPAN&gt; so they can be properly prioritised. Unless you fancy tackling it yourself and contributing back&amp;nbsp; :wink: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 20:01:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191866#M144996</guid>
      <dc:creator>mikeh</dc:creator>
      <dc:date>2008-10-08T20:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Mime Attachments in Web Scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191867#M144997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A "quick and dirty" solution is to specify "&amp;lt;format default="atomfeed"&amp;gt;extension&amp;lt;/format&amp;gt;" in the description file of your webscript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For me, it works with Alfresco 3B, and the form data is in the variable "query".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, for example, you can parse it as XML, look into the file "query.post.cmisquery.js" for parsing it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2008 16:12:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191867#M144997</guid>
      <dc:creator>romain_lamarche</dc:creator>
      <dc:date>2008-10-27T16:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Mime Attachments in Web Scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191868#M144998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Request headers are available via the root objects:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;headersM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The latest HEAD and 3.0E also provide access to the request body via the root object:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;requestbody&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This object may be used as a parameter to the write method.&amp;nbsp; Also supports the properties content (for converting to a string, if possible), encoding and mimetype.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are several web script enhancements in 3.0 that have yet to be documented in the wiki.&amp;nbsp; We'll get there as soon as we can because there's some good gems hidden hiding in there.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2008 17:42:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191868#M144998</guid>
      <dc:creator>davidc</dc:creator>
      <dc:date>2008-10-27T17:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Mime Attachments in Web Scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191869#M144999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want a html client to request cmis ad-hoc query webscript . query.get.cmisquery.js.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This has a specific format reader cmisquery of mimetype attached application/cmisquery+xml.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So how can I make a post request so that this format reader will invoke and read my xml.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color:#FF0000;"&gt;I tried the code below it is not working&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:#FF0000;"&gt;import java.io.*;&lt;BR /&gt;import java.net.*;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;public class upload&lt;BR /&gt;{&lt;BR /&gt;public static void main(String args[]) throws IOException&lt;BR /&gt;{&lt;BR /&gt; URL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; URLConnection&amp;nbsp;&amp;nbsp; urlConn;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OutputStream&amp;nbsp;&amp;nbsp;&amp;nbsp; printout;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataInputStream&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // URL of CGI-Bin script.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = new URL ("&lt;A href="http://localhost:8080/alfresco/service/api/query?alf_ticket=TICKET_a0a5f3589b629e2698cfb01eac987c47d4fea105" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/service/api/query?alf_ticket=TICKET_a0a5f3589b629e2698cfb01eac987c47d4fea105&lt;/A&gt;");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // URL connection channel.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; urlConn = url.openConnection();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Let the run-time system (RTS) know that we want input.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; urlConn.setDoInput (true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Let the RTS know that we want to do output.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; urlConn.setDoOutput (true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // No caching, we want the real thing.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; urlConn.setUseCaches (false);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Specify the content type.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; urlConn.setRequestProperty&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ("Content-Type", "application/cmisquery+xml");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Send POST output.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printout = urlConn.getOutputStream ();&lt;BR /&gt;File fl=new File("1.xml");&lt;BR /&gt;FileInputStream fis=new FileInputStream(fl);&lt;BR /&gt;int i=0;&lt;BR /&gt;byte[] bt=new byte[1024];&lt;BR /&gt;while((i=fis.read(bt))!=-1)&lt;BR /&gt;{&lt;BR /&gt;printout.write(bt,0,1);&lt;BR /&gt;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printout.flush ();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printout.close ();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get response data.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input = new DataInputStream (urlConn.getInputStream ());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String str;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (null != ((str = input.readLine())))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println (str);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input.close ();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:#0000FF;"&gt;and HTML CLIENTis &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:#FF0000;"&gt;&amp;lt;html&amp;gt;&lt;BR /&gt; &amp;lt;head&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Upload Web Script Sample&amp;lt;/title&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;link rel="stylesheet" href="${url.context}/css/main.css" TYPE="text/css"&amp;gt;&lt;BR /&gt; &amp;lt;/head&amp;gt;&lt;BR /&gt; &amp;lt;body&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;table&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;img src="${url.context}/images/logo/AlfrescoLogo32.png" alt="Alfresco" /&amp;gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;nobr&amp;gt;Upload Web Script Sample&amp;lt;/nobr&amp;gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;td&amp;gt;Alfresco ${server.edition} v${server.version}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/table&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;table&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form action="&lt;A href="http://locahost:8080/alfresco/service/api/query" rel="nofollow noopener noreferrer"&gt;http://locahost:8080/alfresco/service/api/query&lt;/A&gt;" method="post" enctype="application/cmisquery+xml"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type="file" name="query"/&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type="submit" name="submit" value="Upload"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/table&amp;gt;&lt;BR /&gt; &amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:#0000FF;"&gt;HERE IS MY XML FILE&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:#FF4000;"&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;BR /&gt;&amp;lt;query xmlns="&lt;A href="http://www.cmis.org/CMIS/2008/05" rel="nofollow noopener noreferrer"&gt;http://www.cmis.org/CMIS/2008/05&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;statement&amp;gt;SELECT name FROM DOCUMENT_OBJECT_TYPE&amp;lt;/statement&amp;gt;&lt;BR /&gt;&amp;lt;searchAllVersions&amp;gt;false&amp;lt;/searchAllVersions&amp;gt;&lt;BR /&gt;&amp;lt;pageSize&amp;gt;0&amp;lt;/pageSize&amp;gt;&lt;BR /&gt;&amp;lt;skipCount&amp;gt;0&amp;lt;/skipCount&amp;gt;&lt;BR /&gt;&amp;lt;returnAllowableActions&amp;gt;false&amp;lt;/returnAllowableActions&amp;gt;&lt;BR /&gt;&amp;lt;/query&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:#FF4000;"&gt;*************ANY ONE OF THE ABOVE CLIENTS ARE NOT WORKING&amp;nbsp; SO……***************&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:#00BF00;"&gt;&lt;STRONG&gt;Please specify the way how can i call this webscript…&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;venky&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2009 12:31:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-mime-attachments-in-web-scripts/m-p/191869#M144999</guid>
      <dc:creator>venky0589</dc:creator>
      <dc:date>2009-02-20T12:31:44Z</dc:date>
    </item>
  </channel>
</rss>

