To attach the files in the mail from the PC
I have a requirement where i have to attach files from the local system and mail it. i have to send the mail with a note also....displaying " Please find attached the following documents" ...
Please suggest the function module that i should use..
At present i am using FM "SO_OBJECT_SEND", but i am facing a problem with this, if i send a folder id and a the body contendt simultaneously, i get a blank attchment.
Please help me get the solution..
Regards,
Abhinav
I am using the following code, and the problem is that i am getting a blank TXT as an attachment.
Please help me solve this issue, if u change the spool request no., client & put ur mail id and execute it u will find that apart from the pdf we get an un wanted attachment also..
Please suggest me the solution..
WORK TABLE AREAS
TABLES: tsp01.
INTERNAL TABLES
DATA: lt_rec_tab LIKE STANDARD TABLE OF soos1 WITH HEADER LINE,
lt_note_text LIKE STANDARD TABLE OF soli WITH HEADER LINE,
lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE.
DATA: lt_objcont LIKE STANDARD TABLE OF soli WITH HEADER LINE,
lt_objhead LIKE STANDARD TABLE OF soli WITH HEADER LINE.
DATA: pdf_format LIKE STANDARD TABLE OF tline WITH HEADER LINE.
TYPES: BEGIN OF y_files,
file(60) TYPE c,
END OF y_files.
DATA: lt_files TYPE STANDARD TABLE OF y_files WITH HEADER LINE.
DATA: l_objcont LIKE soli OCCURS 0 WITH HEADER LINE.
DATA: l_objhead LIKE soli OCCURS 0 WITH HEADER LINE.
STRUCTURES
DATA: folder_id LIKE soodk,
object_id LIKE soodk,
link_folder_id LIKE soodk,
g_document LIKE sood4,
g_header_data LIKE sood2,
g_folmem_data LIKE sofm2,
g_header_data LIKE sood2,
g_receive_data LIKE soos6,
g_ref_document LIKE sood4,
g_new_parent LIKE soodk,
l_folder_id LIKE sofdk,
v_email(50).
DATA: hd_dat LIKE sood1.
VARIABLES
DATA: client LIKE tst01-dclient,
name LIKE tst01-dname,
objtype LIKE rststype-type,
type LIKE rststype-type.
DATA: numbytes TYPE i,
arc_idx LIKE toa_dara,
pdfspoolid LIKE tsp01-rqident,
jobname LIKE tbtcjob-jobname,
jobcount LIKE tbtcjob-jobcount,
is_otf.
DATA: outbox_flag LIKE sonv-flag VALUE 'X',
store_flag LIKE sonv-flag,
delete_flag LIKE sonv-flag,
owner LIKE soud-usrnam,
on LIKE sonv-flag VALUE 'X',
sent_to_all LIKE sonv-flag,
g_authority LIKE sofa-usracc,
w_objdes LIKE sood4-objdes.
DATA: c_file LIKE rlgrap-filename,
n_spool(6) TYPE n.
DATA: cancel.
DATA: desired_type LIKE sood-objtp,
real_type LIKE sood-objtp,
attach_type LIKE sood-objtp,
otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
ali LIKE sood-objtp VALUE 'ALI'. " ABAP lists
CONSTANTS
CONSTANTS: ou_fol LIKE sofh-folrg VALUE 'O',
c_objtp LIKE g_document-objtp VALUE 'RAW',
c_file_ext LIKE g_document-file_ext VALUE 'TXT'.
*=======================================================================
*=
*=========
*z_send_email_fax2
*function z_faian_mail_fax2.
""Interface local:
*" IMPORTING
*" REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
*" REFERENCE(FAX_MAIL_NUMBER) TYPE SO_NAME
*" REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
*" REFERENCE(OBJECT_TYPE) TYPE SO_ESCAPE
*" TABLES
*" LT_BODY_EMAIL STRUCTURE SOLI
*" EXCEPTIONS
*" ERR_NO_ABAP_SPOOLJOB
Fist part: Verify if the spool really exists
*select single * from tsp01 where rqident = src_spoolid.
DATA src_spoolid TYPE tsp01-rqident VALUE '23242'.
DATA header_mail TYPE so_obj_des.
DATA lt_body_email TYPE STANDARD TABLE OF soli WITH HEADER LINE.
DATA l_t VALUE '1'.
header_mail = 'Subject line of mail'.
IF l_t = '1' .
RAISE err_no_abap_spooljob. "doesn't exist
*ELSE.
client = '200'."tsp01-rqclient.
name = 'SPOOL0000023242'."tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = client
name = name
part = 1
IMPORTING
type = type
objtype = objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
OTHERS = 5.
IF objtype(3) = 'OTF'.
desired_type = otf.
ELSE.
desired_type = ali.
ENDIF.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = src_spoolid
desired_type = desired_type
IMPORTING
real_type = real_type
TABLES
buffer = l_objcont
EXCEPTIONS
no_such_job = 14
type_no_match = 94
job_contains_no_data = 54
no_permission = 21
can_not_access = 21
read_error = 54.
IF sy-subrc EQ 0.
attach_type = real_type.
ENDIF.
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
owner = sy-uname
region = ou_fol
IMPORTING
folder_id = l_folder_id
EXCEPTIONS
OTHERS = 5.
fill out informations about the header of the email
CLEAR: g_document.
g_document-foltp = l_folder_id-foltp.
g_document-folyr = l_folder_id-folyr.
g_document-folno = l_folder_id-folno.
g_document-objtp = c_objtp.
g_document-objdes = header_mail.
g_document-file_ext = c_file_ext.
g_header_data-objdes = header_mail.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = 'SAVE'
office_user = sy-uname
IMPORTING
authority = g_authority
TABLES
objcont = lt_body_email
attachments = lt_attachments
CHANGING
document = g_document
header_data = g_header_data
EXCEPTIONS
OTHERS = 1.
folder_id-objtp = l_folder_id-foltp.
folder_id-objyr = l_folder_id-folyr.
folder_id-objno = l_folder_id-folno.
object_id-objtp = c_objtp.
object_id-objyr = g_document-objyr.
object_id-objno = g_document-objno.
link_folder_id-objtp = l_folder_id-foltp.
link_folder_id-objyr = l_folder_id-folyr.
link_folder_id-objno = l_folder_id-folno.
REFRESH lt_rec_tab.
CLEAR lt_rec_tab.
lt_rec_tab-sel = 'X'.
lt_rec_tab-recesc = object_type. "This field for FAX/MAIL
lt_rec_tab-recnam = 'U-'.
lt_rec_tab-deliver = 'X'.
lt_rec_tab-not_deli = 'X'.
lt_rec_tab-read = 'X'.
lt_rec_tab-mailstatus = 'E'.
lt_rec_tab-adr_name = fax_mail_number.
lt_rec_tab-sortfield = fax_mail_number.
lt_rec_tab-recextnam = fax_mail_number.
lt_rec_tab-sortclass = '5'.
APPEND lt_rec_tab.
lt_rec_tab-recextnam = ."Email id .
lt_rec_tab-recesc = 'U'. "object_type.
lt_rec_tab-sndart = 'INT'.
lt_rec_tab-sndpri = 1.
APPEND lt_rec_tab.
c_file = 'C:\Documents and Settings\abgupta\Desktop\Abhinav\zpk.txt'.
lt_files-file = c_file.
APPEND lt_files.
begin of insertion by faianf01
hd_dat-objdes = header_mail.
CALL FUNCTION 'SO_ATTACHMENT_INSERT'
EXPORTING
object_id = object_id
attach_type = attach_type
object_hd_change = hd_dat
owner = sy-uname
TABLES
objcont = l_objcont
objhead = l_objhead
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
object_type_not_exist = 17
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
x_error = 1000.
IF sy-subrc > 0.
ENDIF.
end of insertion by faianf01
lt_note_text-line = 'test prgram for email'.
APPEND lt_note_text.
send email from SAPOFFICE
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = folder_id
object_id = object_id
outbox_flag = outbox_flag
link_folder_id = link_folder_id
owner = sy-uname
check_send_authority = 'X'
TABLES
receivers = lt_rec_tab
note_text = lt_note_text
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
component_not_available = 1
folder_no_authorization = 5
folder_not_exist = 6
forwarder_not_exist = 8
object_no_authorization = 13
object_not_exist = 14
object_not_sent = 15
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
too_much_receivers = 73
user_not_exist = 35.
ENDIF.
COMMIT WORK AND WAIT.
Similar Messages
-
How can I keep tabs on the file size when importing from the Event Library into a Project? I want to ensure the movie will fit onto a 4.7Gb disc?
iDVD does not care about file sizes, as it compresses the file to the standard DVD format of mpeg2.
It only cares about length i.e. max 2 hours including titles etc.
iDVD encoding settings:
http://docs.info.apple.com/article.html?path=iDVD/7.0/en/11417.html
Short version:
Best Performance is for videos of up to 60 minutes
Best Quality is for videos of up to 120 minutes
Professional Quality is also for up to 120 minutes but even higher quality (and takes much longer)
Professional Quality: The Professional Quality option uses advanced technology to encode your video, resulting in the best quality of video possible on your burned DVD. You can select this option regardless of your project’s duration (up to 2 hours of video for a single-layer disc and 4 hours for a double-layer disc). Because Professional Quality encoding is time-consuming (requiring about twice as much time to encode a project as the High Quality option, for example) choose it only if you are not concerned abo
In both cases the maximum length includes titles, transitions and effects etc. Allow about 15 minutes for these.
You can use the amount of video in your project as a rough determination of which method to choose. If your project has an hour or less of video (for a single-layer disc), choose Best Performance. If it has between 1 and 2 hours of video (for a single-layer disc), choose High Quality. If you want the best possible encoding quality for projects that are up to 2 hours (for a single-layer disc), choose Professional Quality. This option takes about twice as long as the High Quality option, so select it only if time is not an issue for you.
Use the Capacity meter in the Project Info window (choose Project > Project Info) to determine how many minutes of video your project contains.
NOTE: With the Best Performance setting, you can turn background encoding off by choosing Advanced > “Encode in Background.” The checkmark is removed to show it’s no longer selected. Turning off background encoding can help performance if your system seems sluggish.
And whilst checking these settings in iDVD Preferences, make sure that the settings for NTSC/PAL and DV/DV Widescreen are also what you want.
http://support.apple.com/kb/HT1502?viewlocale=en_US -
How to fecth the contents of a mail from the server by using jsp
hi
Can any body tell me how to fetch the contents of mail from the server by using javamail api...please send me code if some one have
bye.hi
Can any body tell me how to fetch the contents of mail from the server by using javamail api...please send me code if some one have
bye. -
How can i check the file which is upload from the server
when upload the excel file from the server file to the internal table ,how can i check the data whether it accord with the required condition .
for example ,i want to upload the file which have the data whose type is pack, and it have three integer and two decimal ,how can i check in my code.
thanks,Hi Sichen,
First upload the file, Then do ur validations and delete the records that doesn't satisfy ur requirements.
Thanks,
Vinod. -
you see in the file below the blue line
serparating the sidebar container and the main content container. thats
what i need to do. if somebody help me with that i certainly would appreciatre that
thankEqual height columns in CSS are best acheived with a background-image. This is known as Faux Columns.
Place a background-image in your #container division and repeat-y (down the page). The following background image is for a 3-column layout, but the same method can be used for 2-col, 4-col, etc...
You can see the live page here:
http://alt-web.com/TEMPLATES/3-col-white-gray.html
View Page Source to see the HTML & CSS code.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com -
Does the inability to forward mail from the new In...
(1) Am I right in believing that simply by opening an email you can pick up a trojan or other nasty? That's what I've always heard.
(2) Am I also right in saying that we can no longer 'forward' an email when viewing the list of 50 emails in the Inbox?
(3) If I correct on both counts, if I receive what clearly is a dodgy email and I need to forward it to a Third Party such as Paypal, I can't. To access the Fowrad button, we need to open the blasted email = puts us at risk.ah - STZ1300man - you may have uncovered yet another dastardly attack on we poor XP/IE8 users.
Microsoft tried to kill us off once and failed but so many sites are now demanding IE9 or later so that we may "experience the full delights of everything we are offering"! Gmail, FileHippo and others, and now BT forum.
I'll try later on my Win7/IE9 laptop - I bet that's OK! -
How to attach PDF file along with mail from SAP to external
Hi Experts,
Whenever I am creating PO I should get that creation information ( PO is created & PO no is XXX .) in the form of PDF file & I have to send this PDF file through mail to external. I have to do all this in one development How can I proceed Help me..
ThanksCheck this Code>>>>>>>>>>>
FORM MAIL_OBJECT *
Compiled: Thomas, Satyam Computers Services Ltd.
This routine receives OTF data. OTF data is converted to PDF
format and send to the Partner's email address
FORM mail_object TABLES otf_data STRUCTURE itcoo .
DATA: pdf_size TYPE i, " PDF Size
pdf_itab_size TYPE i, " Attachment size
mailtxt_size TYPE i, " Text in mail size
l_vbeln LIKE vbdka-vbeln. " Order Doc
DATA:
it_mailtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE, " Mail Text
it_pdf TYPE TABLE OF tline WITH HEADER LINE, " OTF output
it_mailpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE, " Dist details
it_mailhead LIKE solisti1 OCCURS 1 WITH HEADER LINE," Header data
it_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE, " Rec List
it_pdfdata LIKE solix OCCURS 0 WITH HEADER LINE. " Attachment data
DATA: it_doc_att LIKE sodocchgi1. " Attri of new doc
DATA: BEGIN OF it_pdfout OCCURS 0, " PDF in 255 length
tline TYPE char255,
END OF it_pdfout.
Sales doc and Customer
DATA: BEGIN OF i_vbeln OCCURS 0,
vbeln LIKE vbpa-vbeln, " Sales Document
adrnr LIKE vbpa-adrnr, " Customer
END OF i_vbeln.
Sender Address no and SMTP address
DATA: BEGIN OF i_addrs OCCURS 0,
addrnumber LIKE adr6-smtp_addr,
smtp_addr LIKE adr6-smtp_addr,
END OF i_addrs.
Convert OTF to PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = pdf_size
TABLES
otf = otf_data
lines = it_pdf.
Make each line 255 characters
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
TABLES
content_in = it_pdf
content_out = it_pdfout.
Create the PDF File
CLEAR it_pdfdata.
REFRESH it_pdfdata.
it_pdfdata[] = it_pdfout[].
LOOP AT it_pdfout.
MOVE it_pdfout-tline TO it_pdfdata-line.
APPEND it_pdfdata.
CLEAR it_pdfdata.
ENDLOOP.
DESCRIBE TABLE it_pdfdata LINES pdf_itab_size.
Text in the mail.
it_mailtxt-line = 'ORDER ACKNOWLEDGEMENT'.
APPEND it_mailtxt.
it_mailtxt-line = ' This is a test mail-Thomas, Line Number--1'.
APPEND it_mailtxt.
it_mailtxt-line = ' This is a test mail-Thomas, Line Number--2' &
' This is a test mail-Thomas, Line Number--2'.
APPEND it_mailtxt.
it_mailtxt-line = ' This is a test mail-Thomas, Line Number--3' &
' This is a test mail-Thomas, Line Number--3' &
' This is a test mail-Thomas, Line Number--3'.
APPEND it_mailtxt.
it_mailtxt-line = ' This is a test mail, Line Number--4' &
' This is a test mail, Line Number--4' &
' This is a test mail, Line Number--4' &
' This is a test mail, Line Number--4'.
APPEND it_mailtxt.
it_mailtxt-line = ' This is a test mail, Line Number--5' &
' This is a test mail, Line Number--5' &
' This is a test mail, Line Number--5' &
' This is a test mail, Line Number--5' &
' This is a test mail, Line Number--5'.
APPEND it_mailtxt.
DESCRIBE TABLE it_mailtxt LINES mailtxt_size.
Document Number for Output
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = vbdka-vbeln
IMPORTING
output = l_vbeln.
Attributes of new doc
CONCATENATE 'Order' space 'Acknowledgement' space l_vbeln
INTO it_doc_att-obj_descr SEPARATED BY space.
it_doc_att-sensitivty = 'F'.
it_doc_att-doc_size = mailtxt_size * 255.
Create Pack to text in mail body.
CLEAR it_mailpack-transf_bin.
it_mailpack-head_start = 1.
it_mailpack-head_num = 0.
it_mailpack-body_start = 1.
it_mailpack-body_num = mailtxt_size.
it_mailpack-doc_type = 'RAW'.
APPEND it_mailpack.
Create Pack to PDF Attach.
it_mailpack-transf_bin = 'X'.
it_mailpack-head_start = 1.
it_mailpack-head_num = 1.
it_mailpack-body_start = 1.
it_mailpack-body_num = pdf_itab_size.
it_mailpack-doc_type = 'PDF'.
CONCATENATE l_vbeln '.pdf' INTO it_mailpack-obj_name.
CONCATENATE 'Order Ack' space l_vbeln INTO it_mailpack-obj_descr.
it_mailpack-doc_size = pdf_itab_size * 255.
APPEND it_mailpack.
*Get email addresses based on Sales document.
SELECT vbeln adrnr INTO TABLE i_vbeln
FROM vbpa
WHERE vbeln = vbdka-vbeln AND
parvw = nast-parvw.
IF NOT i_vbeln[] IS INITIAL.
SELECT addrnumber smtp_addr INTO TABLE i_addrs
FROM adr6 FOR ALL ENTRIES IN i_vbeln
WHERE addrnumber = i_vbeln-adrnr AND
smtp_addr NE space.
ENDIF.
IF i_addrs[] IS NOT INITIAL.
LOOP AT i_addrs.
it_reclist-receiver = i_addrs-smtp_addr.
it_reclist-express = 'X'.
it_reclist-rec_type = 'U'.
it_reclist-notif_del = 'X'. " request delivery notification
it_reclist-notif_ndel = 'X'. " request not delivered notification
APPEND it_reclist.
CLEAR: i_addrs.
ENDLOOP.
ENDIF.
Call FM to send email
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = it_doc_att
put_in_outbox = 'X'
TABLES
packing_list = it_mailpack
object_header = it_mailhead
contents_txt = it_mailtxt
contents_hex = it_pdfdata
receivers = it_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorizationfiltered= 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " MAIL_OBJECT
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-Mohan.
*Reward if helpful** -
I am having problems gettting my mail to work ... Mac telling me that my start up disk id full and to delete some files to free up space ... have done this but when i open mail from the dock it just brings up the colour wheel and nothing happening ... it shows when you right click on the mail icon that " application not responding"
If your hard drive is getting full, you need to free up, at least, 20 GBs of space on your iMac's hard drive.
If your Mac is running a fairly recent version of OS X, here are some general guidelines.
Follow some of my tips for cleaning out, deleting and archiving data from your Mac's internal hard drive.
Have you emptied your iMac's Trash icon in the Dock?
If you use iPhoto, iPhoto has its own trash that needs to be emptied, also.
If you use Apple Mail app, Apple Mail also has its own trash area that needs to be emptied, too!
Other things you can do to gain space.
Delete any old or no longer needed emails and/or archive to disc, flash drives or external hard drive, older emails you want to save.
Look through your Documents folder and delete any type of old useless type files like "Read Me" type files.
Again, archive to disc, flash drives, ext. hard drives or delete any old documents you no longer use or immediately need.
Download an app called OnyX for your version of OS X.
When you install and launch it, let it run the automatic ans S.M,A.R.T. tests, then go to the cleaning and maintenance tabs and run the tabs that have the ability to clean out all web browser cache files, web browser histories, system cache files, delete old error log files.
Typically, iTunes and iPhoto libraries are the biggest users of HD space.
move these files/data off of your internal drive to the external hard drive and deleted off of the internal hard drive.
If you have any other large folders of personal data or projects, these should be archived or moved, also, to the optical discs, flash drives or external hard drive and then either archived to disc and/or deleted off your internal hard drive.
Good Luck! -
If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?
Also i have reinstalled the reader9 two times and tried with reader8 also but in both the cases same problem.
it would be gr8 help if someone can help. -
I want to have Mail list Received e-mails chronologically without attaching new e-mails received to older e-mails from the same recipient/with the same title. Is there a Preferences setting or a toggle to set this?
View menu.
Uncheck "Organize by Conversation."
Regards,
Barry
BTW: Mail is part of the bundled "System software" and is discussed in the community for your version of OS X:
Mac OS X v10.7 Lion
The link will take you there.
Edit: I see someone has requested a transfer, and this conversation is now in the correct space.
Barry -
How do I attach a file to a Mail doc without the file being opened in the Mail document?
How do I attach a file to a Mail doc without the file being opened in the Mail document?
You will (often) see a preview of the attachment, depending upon the file type. To get rid of the preview: control click on the attachment select "View as icon".
(What the recipient of your message sees is dictated by that person's email application. If you want to make sure the person gets an attachement which is not previewed, you can zip it (control-click, "Compress...") and then attach the zipped file(s). Or you can try something like Attachment Tamer.) -
When I attach a file to outgoing mail it shows up in the body of the e-mail. How can i make it only show up at the end or elsewhere?
Edit > Attachments > Insert Attachments at End of Message. If a new message is the active window, the option applies only to that message. If you don't have a new message open, then the option becomes Always Insert Attachments at End of Message.
-
How to Send a Mail From the Oracle Applications.
Hi,
I was assigned a task to send a mail from the front end i.e., from oracle applications.
but i have no idea.
i am working on oracle apps R12.1.1 and 10g reports.
First i have to create an rdf file and that rdf file i want to send as an attachment through mail from the apps.
Any Advice will be of great help and i will follow accordingly.
Thanks in Advance,
Regards,
Bharathi.SHi,
I was assigned a task to send a mail from the front end i.e., from oracle applications.
but i have no idea.
i am working on oracle apps R12.1.1 and 10g reports.
First i have to create an rdf file and that rdf file i want to send as an attachment through mail from the apps.
Any Advice will be of great help and i will follow accordingly.
Thanks in Advance,
Regards,
Bharathi.S -
Hello,
I am creating an app using NAPA tool in Office 365. I am trying to "Add an attachment" to a custom list item using SPServices. When I am using my code (jquery code) in content editor web part on a page, its working fine, but when I am adding
the same code in an app, its giving me error : "The system cannot find the file specified. (Exception from HRESULT:
0x80070002)" - 500 Internal Server error.
(function () {
// This code runs when the DOM is ready and creates a context object which is
// needed to use the SharePoint object model
$(document).ready(function () {
//alert('In doc ready');
$('.attachmentButton').change(function(event){
var listName = 'UploadTest',
itemId = 2;
handleFileChange(listName,itemId,event.target.files);
function handleFileChange(listName,itemId,files){
alert('In handleFileChange :=' + listName + "" + itemId + "" + files[0]);
alert('files.length :=' + files.length);
var filereader = {},
file = {},
i=0;
//loop over each file selected
for(i = 0; i < files.length; i++) {
alert('In for loop');
file = files[i];
filereader = new FileReader();
filereader.filename = file.name;
alert('filereader.filename :=' + filereader.filename);
filereader.onload = function() {
var data = this.result;
var n=data.indexOf(";base64,") + 8;
//alert('n :=' + n);
//removing the first part of the dataurl give us the base64 bytes we need to feed to sharepoint
data= data.substring(n);
//alert('data :=' + data);
alert('Above SPServices this.filename :=' + this.filename);
$().SPServices({
operation: "AddAttachment",
listName: listName,
asynch: false,
listItemID:itemId,
fileName: this.filename,
attachment: data,
completefunc: function (xData, Status) {
console.log('attachment upload complete',xData,status);
alert('Status :=' + Status);
if (Status.toLowerCase() == "error"){
alert(xData.responseText);
alert(xData.status);
alert(xData.statusText);
filereader.onabort = function() {
alert("The upload was aborted.");
filereader.onerror = function() {
alert("An error occured while reading the file.");
//fire the onload function giving it the dataurl
filereader.readAsDataURL(file);
alert(xData.responseText); - gives error - " "The system cannot find the file specified. (Exception from HRESULT: 0x80070002)""
alert(xData.status); - gives error - "500"
alert(xData.statusText); - gives error - "Internal server error"
Server Publishing infrastructure and Server publishing features are activated on site collection and site respectively.
Any suggestions, why I am getting this error in NAPA ?Hi,
According to your post, my understanding is that you have an issue about adding attachments to list items in app.
To add attachment to list item in the host web, we should first get the list and the list items from the host web, then add the attachments to the list items.
There are two articles about retrieve the list and list items in the host web, you can refer to them.
http://www.dotnetcurry.com/showarticle.aspx?ID=1028
http://www.c-sharpcorner.com/UploadFile/93cb27/retrieve-sharepoint-app-host-web-list-items-in-sharepoint-ho/
What’s more, we can also use the REST API to achieve the same scenario.
http://www.c-sharpcorner.com/UploadFile/472cc1/add-attachments-to-list-items-in-sharepoint-2013-using-rest/
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support -
I have two different e-mail addresses that I want to get mail from. So the main/default one worked just fine. So I went to options, account settings, identities and set up the second one. But this second one doesn't appear on the start page and still when I Get Mail, it only brings in the mail from the default one. So what do I do?
You do not place your second account in Identities.
You go to the Menu Bar and select '''File-New-Existing Mail Account''' and add it there.
No Menu Bar? Press the alt key.
If using the '''AppMenu button''', click that and select''' New Message-Existing Mail Account''' -
Mail Won't Quit, and Keeps Reloading Old Mail from the Server
I recently had an apparent laptop battery failure while in Mail (while on battery). The machine abruptly shut down with no warning with about 55% power still available. It did this subsequently at random power levels. But, it always worked on the line power adapter. There have been no recurrences with a new battery.
Since I archive all my mail on my desktop machine, the laptop is set to NOT remove messages from the server after downloading.
1. After the first power failure with Mail active, on restart I got message from Mail to the effect that there was something wrong with the mail indexing, and if I would do X (don't remember what), then it would be fixed. I did X, and the system came up.
But, it had lost track of which messages had already been downloaded. Every time Mail was launched in downloaded the entire contents of the server spool, leading to massive duplications.
2. Then I discovered that I could not quit the application. If you tried, the first time it would close the message window, but remain active on the menu bar, with the "Quit" box grayed out.
I could force it to quit, but that may have been leading to it forgetting which mails it had already read.
I have run the disk utility, including the permissions check, and it reports that all is well.
I have reloaded Mail from the System disc, with no improvement.
I have tried deleting the com.apple.mail.plist file. But when Mail opens and brings up the Setup window, it fails to find the outgoing mail server.
Replacing the new plist with the original fixes the outgoing problem, but whether the new or old plist is in place, the multiple downloads and failing to quit both happen.
Since all of these attempts, a new symptom has emerged:
3. When dragging the Inbox messages to the trash (or using the Delete button), they do go to the trash, but remain in the inbox as well.
Any thoughts?FYI: I found that there were two very-similarly-named folders in the users/(home)/Library/Mail folder.
One was called: POP-(username)@(ISP popservername).(ISP domain).
The other was called POP-(username)@(ISP popservername)@(ISP domain).
They both contained some of the core mail boxes, e.g. Deleted Messages, INBOX, Junk etc.
However, only one had the file: MessageUidsAlreadyDownloaded.
I copied the user mailboxes elsewhere and trashed these two folders. But opening Mail recreated them with all the same issues.
I trashed them again, along with the (boot disk)/Library/Mail, and the (bootdisk)/Applications.Mail.app file.
Then I reloaded the Mail app from the OS 10.5 Install DVD.
Launching Mail and setting its preferences cleared up the problem. Only one of the pop folders showed up and it correctly tracked the already downloaded files, and quit normally when asked.
Maybe you are looking for
-
I want to go back to the older version of Firefox so I can use "delicious". I can't install the button for Delicious because it says it's not compatible with Firefox 4.0.1 help!!!
-
ITunes no longer plays song files in 5.1 - only in Stereo
Greetings! Unfortunately, since a few days ago, iTunes has stopped playing my songs in surround sound and is instead only using my front speakers currently, while I can play the very same songs in surround sound using a different audio player. I've t
-
Error 6 in write to spreadshee​t file
Hello. My program reads a 1D array of 12 values, then increments each value as the controlled components activate. The program then writes the new value back to the file, replacing the old value. After running for a time, I get the following error
-
To get content of file upload element in web dynpro
Hi . . . h1 : how can i get the string content (i.e., path of file) store in variable in web dynpro abap . . . .
-
How can i search a text value on an image file?? Does UCM have this ability or we use third party programs?