Upload multiple attachments
Hi,
I use the below code to add attachments to Siebel FS - I would like to add all the files under a specific directory as attachment to a specific parent (case) record.
This code adds one specific file successfully - but need to know how to do the same for multiple files at one shot.
thanks.
Venkat.
function WebApplet_PreInvokeMethod (MethodName)
if (MethodName == "PutFileNow")
var oBO = TheApplication().ActiveBusObject();
var oBC = oBO.GetBusComp("HLS Cases Attachment");
var RetValue;
oBC.NewRecord(NewAfter);
RetValue = oBC.InvokeMethod ("CreateFile", "C:\\test.JPG","HLSFileName","N");
oBC.WriteRecord();
return(CancelOperation);
return (ContinueOperation);
--------
What you can do is to make a system call with a good old dir command where you pipe the output to a file and the read the file afterwards.
Have a look at:
Clib.system
Clib.fopen
Clib.fgets
Clib.fclose
Axel
Similar Messages
-
Upload multiples attachments in sharepoint list programmatically
Hi sir,
I want To upload multiple attachments in sharepiont list programmatically.plesse suggest me
vijayHello,
The TechNet Sandbox forum is designed for users to try out the new forums functionality. Please be respectful of others, and do not expect replies to questions asked here.
As it's off-topic here, I am moving the question to the
Where is the forum for... forum.
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book:
Windows PowerShell 2.0 Bible
My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}}) -
Upload multiple attachments in sharepoint 2010 list
I want to have multiple attachment column in sharepoint list.is there any way to have this?
I have one list and now I want to create a scenario that at a time user can attach more then one file like they do in Gmail.
Can I achieve this using SharePoint 2010 list?Yes, those links for server object model.
You can also do same with client object model:
http://withinsharepoint.com/archives/111
http://ranaictiu-technicalblog.blogspot.in/2010/06/sharepoint-2010-attach-files-to.html
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
I am getting a error IO when trying to upload multiple images within wordpress using the flash uploader. I do not get the error when uploading using explorer. The error only appears if I try uploading using firefox....any ideas?
Logged the call with SAP who directed me to 'Define settings for attachments' in IMG and setting the 'Deactivate Java Applet' & 'Deactivate Attachment versioning' checkboxes - problem solved.
-
Hi,
I have designed a infopath form which is having multiple attachment control and user will upload multiple documents on it.
The problem in sharepoint infopath form is user's are unable to attach large files which is more than 5 MB (since default limit is 4096KB).
I know we can increase the User session data for Infopath in central admin .But that will impact our server CPU since we want to increase to 50 MB.
I got the other approach which is like storing the documents in sharepoint document library and adding the attachments as a hyperlink in infopath form which will reduce the size of the form and will not affect performance.
Can anyone please provide the detailed explanation and method here(if possible with screenshots)
Thanks & regards,
PooviHello,
I also had same requirement earlier and what i did, i have given the doc library link to infopath form to upload file. Then create new web service data connection to get files from library to infopath and show as hyperlink. Basically you can add one repeating
section with hyperlink control to bind the files in IP.
You may refer this blog and it has explained exactly same approach
http://sharepointvenividivici.typepad.com/sharepoint-customization/2013/01/infopath-show-links-to-documents-in-a-library-from-the-form.html
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help -
I'm not being lazy, I have looked through many of the threads and don't seems to be able to find the answer to this query, if anyone can offer any assistance I'd be very grateful.
I want to send email with multiple attachments and I'm taking advantages of the demo_mail functionality already in place. I can successfully send email with and attachment by passing in the file name from the wwv.flows table after I've uploaded the file. The problem is that I'm not sure how to pass multiple attachments. I imagine I would either be passing multiple file names or combining the blobs?
Code as follows:
procedure email_attachments_asis(
p_sender varchar2, -- sender, example: 'Me '
p_recipients varchar2, -- recipients, example: 'Someone '
p_subject varchar2, -- subject
p_body varchar2, -- body
p_filename varchar2, -- name of pdf file
p_blob blob, -- file(s)
p_mime_type varchar2,
p_number_to_attach number) is
conn utl_smtp.connection;
i number;
len number;
v_eol VARCHAR2(2) := chr(13)||chr(10);
BEGIN
conn := demo_mail.begin_mail(
sender => p_sender,
recipients => p_recipients,
subject => p_subject,
mime_type => demo_mail.MULTIPART_MIME_TYPE);
if p_number_to_attach > 1 then
demo_mail.attach_text(
conn => conn,
data => p_body,
mime_type => p_mime_type);
elsif p_number_to_attach = 1 then
demo_mail.attach_text(
conn => conn,
data => p_body,
mime_type => p_mime_type);
end if;
for counter in 1..p_number_to_attach loop
demo_mail.begin_attachment(
conn => conn,
mime_type => p_mime_type,
inline => TRUE,
filename => p_filename,
transfer_enc => 'base64');
-- split the Base64 encoded attachment into multiple lines
i := 1;
len := DBMS_LOB.getLength(p_blob);
WHILE (i < len) LOOP
IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
UTL_SMTP.Write_Raw_Data (conn
, UTL_ENCODE.Base64_Encode(
DBMS_LOB.Substr(p_blob, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
ELSE
UTL_SMTP.Write_Raw_Data (conn
, UTL_ENCODE.Base64_Encode(
DBMS_LOB.Substr(p_blob, (len - i)+1, i)));
END IF;
UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
END LOOP;
end loop;
demo_mail.end_attachment(conn => conn);
demo_mail.end_mail( conn => conn );
END email_attachments_asis;The method I would use is:
1) Write a utility function that accepts a SQL cursor, converts it to XML and applies a XSL stylesheet to convert it to an HTML table and return the result as a CLOB. An example that I based code on is here. My modified example that accepts the stylesheet is at the end.
2) For each report, run the function and attach it to the email.
FUNCTION FNCREFCURSOR2XML
( p_refCursor SYS_REFCURSOR,
p_stlsht CLOB,
p_parms VARCHAR2 default null)
RETURN CLOB
IS
lRetVal CLOB;
lHTMLOutput XMLType;
lXMLData XMLType;
lContext DBMS_XMLGEN.CTXHANDLE;
stringarg varchar2(200);
BEGIN
-- get a handle on the ref cursor --
lContext := DBMS_XMLGEN.NEWCONTEXT(p_refCursor);
-- setNullHandling to 1 (or 2) to allow null columns to be displayed --
DBMS_XMLGEN.setNullHandling(lContext,1);
-- create XML from ref cursor --
lXMLData := DBMS_XMLGEN.GETXMLTYPE(lContext,DBMS_XMLGEN.NONE);
if lXMLData is null then
DBMS_XMLGEN.CLOSECONTEXT(lContext);
close p_refCursor;
return null;
end if;
DBMS_OUTPUT.PUT_LINE('xmldata = ' || lXMLData.getStringVal());
-- XSL transformation to convert XML to HTML --
--stringarg:=regexp_replace(p_parms,'"([[:alnum:][:space:]]*)"','"string(' || '''' || '\1' || '''' || ')"',1,0,'m');
lHTMLOutput := lXMLData.transform(XMLType(p_stlsht),p_parms);
-- convert XMLType to Clob --
lRetVal := dbms_xmlgen.convert(lHTMLOutput.getClobVal(),DBMS_XMLGEN.ENTITY_DECODE );
--lRetVal := lHTMLOutput.getClobVal();
lRetVal := regexp_replace(lRetVal,'_x0020_',' ',1,0,'m');
lRetVal := regexp_replace(lRetVal,'_x0026_','&',1,0,'m');
lRetVal := regexp_replace(lRetVal,'_x003C_','<',1,0,'m');
lRetVal := regexp_replace(lRetVal,'_x002F_','/',1,0,'m');
lRetVal := regexp_replace(lRetVal,'_x003E_','>',1,0,'m');
lRetVal := regexp_replace(lRetVal,'>','>',1,0,'m');
lRetVal := regexp_replace(lRetVal,'<','<',1,0,'m');
lRetVal := regexp_replace(lRetVal,'"','"',1,0,'m');
lRetVal := regexp_replace(lRetVal,'&','&',1,0,'m');
--lRetVal := lHTMLOutput.getStringVal();
DBMS_XMLGEN.CLOSECONTEXT(lContext);
CLOSE p_refCursor;
RETURN lRetVal;
end fncRefCursor2XML;-----
Example Stylesheet:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:param name="title"/>
<xsl:param name="widthpx" />
<xsl:param name="widthpct" />
<xsl:template match="/">
<div style="width:100%">
<table border="1px" class="t16standard" style="border-collapse:collapse">
<xsl:if test="string-length($widthpx) > 0">
<xsl:attribute name="width">
<xsl:value-of select="$widthpx"/>px
</xsl:attribute>
</xsl:if>
<xsl:if test="string-length($widthpct) > 0">
<xsl:attribute name="width">
<xsl:value-of select="$widthpct"/>%
</xsl:attribute>
</xsl:if>
<xsl:if test='string-length($title) > 0 '>
<tr>
<th style="font-size:14px;background:#9DB8D2">
<xsl:attribute name="colspan">
<xsl:value-of select="count(/ROWSET/ROW[1]/*)"/>
</xsl:attribute>
<xsl:attribute name="align">center</xsl:attribute>
<xsl:value-of select="translate($title,'_',' ')"/>
</th>
</tr>
</xsl:if>
<tr>
<xsl:for-each select="/ROWSET/ROW[1]/*">
<th class="t16ReportHeader"><xsl:value-of select="name()"/></th>
</xsl:for-each>
</tr>
<xsl:for-each select="/ROWSET/*">
<tr>
<xsl:for-each select="./*">
<td>
<xsl:choose>
<xsl:when test="string(@bgcolor)">
<xsl:attribute name="bgcolor">
<xsl:value-of select="@bgcolor" />
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="bgcolor">#FFFFFF</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string(@style)">
<xsl:attribute name="style">
<xsl:value-of select="@style" />
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="style">
padding:3px
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="text()"/> </td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</div>
</xsl:template>
</xsl:stylesheet>Edited by: Fairfax_Al on Apr 15, 2009 4:17 PM -
Contract Importer - Uploading Multiple Contract Documents for the same MA
Is it possible to upload multiple contract documents against the same master agreement when using the contract importer tool.
If so, what is the format for specifying the various filenames that represent these documents.
Thanks,
TanmayaHi,
Yes this is feasible.
What we had done is uplaoded the MA first and then loaded a separate csv for Attachments. This can then be placed on the desired location and picked up via the attachment importer mapping file. Just FYI, this can be configured in the System properties to import the file into E-Sourcing.
Hope this is helpful,
Vikram -
How to handle Multiple attachments in sender Mail Adapter
Hi,
In our requirement is mutiple documents send through mail adapter, In custom java module we read the each document details and do it bussiness process. But now i am not able to read the multiple files at a time. we are able to read single file only. So plz give the solution for that.
1) How to send multiple attachments(like word, PDF, JPG etc..) using mail apapter.
2) How to read multiple attachments in custom java module.
Thanks & Regards
VijayHi Vijay,
Go through this weblog this explains steps to multile attachments.
/people/sravya.talanki2/blog/2006/01/12/xi-triggering-e-mails-with-multiple-attachments--problems
Regards,
Ashwin. -
Upload multiple files WITH correct pairs of form fields into Database
In my form page, I would like to allow 3 files upload and 3 corresponding text fields, so that the filename and text description can be saved in database table in correct pair. Like this:
INSERT INTO table1 (filename,desc) VALUES('photo1.jpg','happy day');
INSERT INTO table1 (filename,desc) VALUES('photo2.jpg','fire camp');
INSERT INTO table1 (filename,desc) VALUES('photo3.jpg','christmas night');
However, using the commons fileupload, http://commons.apache.org/fileupload/, I don't know how to reconstruct my codes so that I can acheieve this result.
if(item.isFormField()){
}else{
}I seems to be restricted from this structure.
The jsp form page
<input type="text" name="description1" value="" />
<input type="file" name="sourcefile" value="" />
<input type="text" name="description2" value="" />
<input type="file" name="sourcefile" value="" />The Servlet file
package Upload;
import sql.*;
import user.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.Map;
import java.util.HashMap;
import java.util.Date;
import java.util.List;
import java.util.Iterator;
import java.io.File;
import java.io.PrintWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.*;
public class UploadFile extends HttpServlet {
private String fs;
private String category = null;
private String realpath = null;
public String imagepath = null;
public PrintWriter out;
private Map<String, String> formfield = new HashMap<String, String>();
//Initialize global variables
public void init(ServletConfig config, ServletContext context) throws ServletException {
super.init(config);
//Process the HTTP Post request
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Thumbnail thumb = new Thumbnail();
fs = System.getProperty("file.separator");
this.SetImagePath();
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if(!isMultipart){
out.print("not multiple part.");
}else{
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List items = null;
try{
items = upload.parseRequest(request);
} catch (FileUploadException e) {
e.printStackTrace();
Iterator itr = items.iterator();
while (itr.hasNext()) {
FileItem item = (FileItem) itr.next();
if(item.isFormField()){
String formvalue = new String(item.getString().getBytes("ISO-8859-1"), "utf-8");
formfield.put(item.getFieldName(),formvalue);
out.println("Normal Form Field, ParaName:" + item.getFieldName() + ", ParaValue: " + formvalue + "<br/>");
}else{
String itemName = item.getName();
String filename = GetTodayDate() + "-" + itemName;
try{
new File(this.imagepath + formfield.get("category")).mkdirs();
new File(this.imagepath + formfield.get("category")+fs+"thumbnails").mkdirs();
//Save the file to the destination path
File savedFile = new File(this.imagepath + formfield.get("category") + fs + filename);
item.write(savedFile);
thumb.Process(this.imagepath + formfield.get("category") +fs+ filename,this.imagepath + formfield.get("category") +fs+ "thumbnails" +fs+ filename, 25, 100);
DBConnection db = new DBConnection();
String sql = "SELECT id from category where name = '"+formfield.get("category")+"'";
db.SelectQuery(sql);
while(db.rs.next()){
int cat_id = db.rs.getInt("id");
sql = "INSERT INTO file (cat_id,filename,description) VALUES ("+cat_id+",'"+filename+"','"+formfield.get("description")+"')";
out.println(sql);
db.RunQuery(sql);
} catch (Exception e){
e.printStackTrace();
HttpSession session = request.getSession();
UserData k = (UserData)session.getAttribute("userdata");
k.setMessage("File Upload successfully");
response.sendRedirect("./Upload.jsp");
//Get today date, it is a test, actually the current date can be retrieved from SQL
public String GetTodayDate(){
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String today = format.format(new Date());
return today;
//Set the current RealPath which the file calls for this file
public void SetRealPath(){
this.realpath = getServletConfig().getServletContext().getRealPath("/");
public void SetImagePath(){
this.SetRealPath();
this.imagepath = this.realpath + "images" +fs;
}Can anyone give me some code suggestion? Thx.When one hits the submit button - I then get a 404 page error.What is the apaches(?) error log saying? Mostly you get very useful information when looking into the error log!
In any case you may look at how you are Uploading Multiple Files with mod_plsql. -
Upload multiple files to a data item in sharepoint list
The image above shows a list item with two pdf files attached to it. This is an access databse that was pushed to this sharepoint list. When we attached these files we used the "attach file" from the edit menu at the top of the page.
They are put into a data item called "copy of sepration report", which I can't seem to find when I edit the list. As a further on discussion of this we would like to be able to upload multiple items into their own data field. I.E.
one could be seperation report, and another could be accidents, and another would be disciplinary. Each would have the capability of having multiple items uploaded to it.
What am I missing????Since you can't attach document to list item field, you may need to think other way around. You can create a document library and have the document library all these fields (separation report, copy of separation report etc.). So instead of list item having
the documents attached, the document library will have the fields attached. Also you can group the fields into two groups - fields that are not directly related to document and fields that are directly related to document. Then you can move the document related
fields to document library and create another list with the non-related-to-document fields and linking this new list to document library using lookup
Thanks,
Sohel Rana
http://ranaictiu-technicalblog.blogspot.com -
How can I upload multiple files in a master detail relationship?
I would like to be able to upload several files for one record (a one to many relationship). I tried using a master detail form, but the tabular form does not support file browse. I've searched the forum and found several examples asking how to upload multiple files at once. That is not what I'm trying to do. I simply want the user to browse, select a file, provide a file name and description. Then select the next file. When they are done selecting files (it may be one file or many files) I want them to hit the submit button and I'll run a procedure that saves the files to the database.
How can I do this? Thanks, you guys are the best. ElizabethElizabeth,
I had this situation come up once and here's what I did, thought it may not be exactly what you're looking for.
I created a collection to store the ID's of the files that had been uploaded, along with the key and other information. The file browse input will upload your files into the wwv_flow_files table on submit. I was storing the documents in another application table.
The after submit process grabs the id from wwv_flow_files where the name is = to your file input.
After you add that ID and your associated master key in the collection, your final submit process fetches the files from wwv_flow_files and inserts them into your own table.
I can put an example on apex.oracle.com if that would be helpful.
Thanks,
Jeff -
Thankyou.
How are you accessing facebook? I do it through Safari and can upload multiple pics. Are you doing that or through the app?
-
How can we send multiple attachments in a mail from iPad 2
Hi,
I am using a ipad2. I want to know how we can send multiple attachments through mail from iPad. I did not find any option of doing this. Is there a way to do this.
Regards,
SatyabratYou can't do it natively on the iPad (unless you just want to send up to 5 photos from the Photos app). I use the GoodReader app which supports quite a few document/file types (e.g. PDF, Excel, Word, pictures), and from that I can select multiple files (including different types) and attach them to the same email.
-
How to accept multiple attachments on selection screen?
Hi All,
I need to know how to accept multiple attachments on selection screen and send them as email to external system (outlook).
Basically, my req is to send a common email with attachments to certain users. These users are displayed in ALV. User will select ALL or specific user from ALV and send an email with message entered on selection screen.
I used text editor control to input message body. I need to know how to accept attachments and send them.
Appreciate any inputs.
Thanks,
SKJSAP uses a nifty little button called 'Object Services' on ME23N (top left) which you can use to attach documents to business objects.
http://help.sap.com/saphelp_nw70/helpdata/EN/be/3fe63659241157e10000009b38f889/frameset.htm
It's a complicated way of doing it but might give you extra functionality in the long run. -
I am attempting to upload multiple photos on a mac pro from a cd. I have tried holding the "command"button down to select multiple photos but it does not work. Please advise. Thanks,John
why not sort by (name, date, etc) and Click on 1st and Shift-Click on last.
Might work better to copy or import to a project folder.
https://discussions.apple.com/community/ilife/iphoto
http://www.apple.com/support/iphoto
Maybe you are looking for
-
Windows 8.1 update from Windows 8 single language upgraded to pro
Hello, I have a computer that have windows 8 Single Language installed, i had upgraded to windows 8 pro with a license i´ve bought, i had installed all updates, now windows store shows upgrade to windows 8.1 but this upgrade is for Windows 8 Single L
-
I've got a frustrating problem and need your help. My Mac pro (os 10.7.5) froze so I was forced to push the button to restart. After reboot, apple mail 5.3 auto opened and pulled in thousands of old mail that were long ago deleted. Now, is there a wa
-
Receive mail with PDF attachment into XI and send to ABAP proxy
Hi, I have a scenario where I need to receive a mail into XI that has a PDF attachment. This attachment needs to be retained as ultimately I need to send the message into CRM via an ABAP proxy and read the attachment and load against a business partn
-
Income statement report base on location..
Hi Experts, Are there ways to configure SAP that it will be able to Generate FS report base on location? are fields available for this requirement? Much thanks, Jose mari Dres
-
Two master machine after reconnection
We are using the Berkeley DB 5.1.19 with the standard replication manager. We test the given sample "excxx_repquote" in a two machine configuration ( one master and one slave) with the following configuration - ACK quoroum - nsite=1 - priority =100 -