asp.net - How do I upload a file to an Acumatica Screen through HTTP virtual path? -


how upload file acumatica screen through http virtual path? example, upload mysite.com/files/abc.pdf sales orders screen.

below code snippet achieve goal.it reading file http url , attaching 1 of existing case.

      //graph file management       px.sm.uploadfilemaintenance filegraph = pxgraph.createinstance<px.sm.uploadfilemaintenance>();       //since need file http url - below sample       webrequest request = webrequest.create("http://www.pdf995.com/samples/pdf.pdf");       using (system.io.stream datastream = request.getresponse().getresponsestream())       {           using (system.io.memorystream mstream = new system.io.memorystream())           {               datastream.copyto(mstream);               byte[] data = mstream.toarray();                                 //create file info, may check different overloads per need               px.sm.fileinfo fileinfo = new px.sm.fileinfo("case.pdf", null, data);                if (filegraph.savefile(fileinfo))               {                   if (fileinfo.uid.hasvalue)                   {                       // attach file case screen - example                       crcasemaint graphcase = pxgraph.createinstance<crcasemaint>();                        //locate existing case                       graphcase.case.current = graphcase.case.search<crcase.casecd>("<case want attach file>");                        //to attach file                       pxnoteattribute.setfilenotes(graphcase.case.cache, graphcase.case.current, fileinfo.uid.value);                        //to attach note                       pxnoteattribute.setnote(graphcase.case.cache, graphcase.case.current, "<note wish specify>");                        //save case                       graphcase.save.press();                   }               }           }       } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -