Uploading a file from user's local machine and put it in oracle table
Hello All experts,
I have a requirement such that the file from User's local machine needs to be uploaded and the custom oracle table needs to be populated.
Any answers how to do this?Sounds challanging right?
Thanks
Kumar
Have a look at attachments API, since this also does the same thing except that it puts the file in fnd_lobs instead of the custom table.
Thanks
Tapash
Similar Messages
-
How do I extract my music files from a evternal hard drive and put them on my itunes?
how do I extract my music files from a evternal hard drive and put them on my itunes?
If you used the Finder to move the files, iMovie will have lost track of them. iMovie holds the locations of the Event files, and Project files contain references to those locations. If you move the files, iMovie has no way of knowing where they are.
If you can, first move all the files back to their original locations. Plug in the external drive. Open iMovie and move the files in iMovie's interface (help explains how, but basically, just drag and drop in the event pane).
Then you can connect the drive to the new computer, and iMovie will see them. -
firefox 7.0 - Can not upload the file from local machine to server...gives "error 404 : file not found"
you have not understood my point
how does this code will run on servlet when I want to upload a file from client's
machine to server machine
what I am doing is I am giving an option to the user that he/she can browse the file and then select any file and finally it's action is post in the jsp form for which I have sent the code
All the computers are connected in LAN
So how to upload a file from client's machine to server's machine
Plz give me a solution -
To upload a file from client machine to server machine
Hi everybody!
Could anyone plz help me. I am struck in a problem
I want to transfer a file from client's machine to server but I am not able to upload
It is tranferring the file only to the local machine
I am using orielley package It is transferring files only to my local machine but not to the server .Can anyone correct it. It's very urgent
how to write the relative path for server
I am using this path and it is not uploading
MultipartRequest multi = new MultipartRequest(request, "../<administrator>:<dev2daask>@dev2:C:/123data/", 5 * 1024 * 1024);
Here is my code:
<%@ page import="java.util.*" %>
<%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page import="java.io.*" %>
<%@ page import="com.oreilly.servlet.MultipartRequest"%>
<%
try {
// Blindly take it on faith this is a multipart/form-data request
// Construct a MultipartRequest to help read the information.
// Pass in the request, a directory to saves files to, and the
// maximum POST size we should attempt to handle.
// Here we (rudely) write to the server root and impose 5 Meg limit.
MultipartRequest multi = new MultipartRequest(request, "../<administrator>:<dev2daask>@dev2:C:/123data/", 5 * 1024 * 1024);
out.println("<HTML>");
out.println("<HEAD><TITLE>UploadTest</TITLE></HEAD>");
out.println("<BODY>");
out.println("<H1>UploadTest</H1>");
// Print the parameters we received
out.println("<H3>Params:</H3>");
out.println("<PRE>");
Enumeration params = multi.getParameterNames();
while (params.hasMoreElements()) {
String name = (String)params.nextElement();
String value = multi.getParameter(name);
out.println(name + " = " + value);
out.println("</PRE>");
// Show which files we received
out.println("<H3>Files:</H3>");
out.println("<PRE>");
Enumeration files = multi.getFileNames();
while (files.hasMoreElements()) {
String name = (String)files.nextElement();
String filename = multi.getFilesystemName(name);
String type = multi.getContentType(name);
File f = multi.getFile(name);
out.println("name: " + name);
out.println("filename: " + filename);
out.println("type: " + type);
if (f != null) {
out.println("length: " + f.length());
out.println();
out.println("</PRE>");
catch (Exception e) {
out.println("<PRE>");
out.println("</PRE>");
out.println("</BODY></HTML>");
%>you have not understood my point
how does this code will run on servlet when I want to upload a file from client's
machine to server machine
what I am doing is I am giving an option to the user that he/she can browse the file and then select any file and finally it's action is post in the jsp form for which I have sent the code
All the computers are connected in LAN
So how to upload a file from client's machine to server's machine
Plz give me a solution -
How to allow the user to upload a file from their desktop to MII Server?
Hi,
Is there a way for the user to specify a file on their local computer to upload to the MII server for processing? We have a method that works for uploading from a shared network drive, but now the need/desire is to allow the user to upload a file from their desktop.
Ideally, this would be a file browser that the user would click on to browse their local desktop and select the file and click "Upload" but not sure what's possible?
This is using 12.1 SP4.
Thanks for the help.
Kerby[Uploading Documents|Uploading Documents]
-
How to allow user to select pdf file on local machine and populate field with file name only
Folks,
I have a project requirement that I am stumped on. I am admittedly a novice, so forgive questions that may seem obvious.
My requirement is a form running on a client system where the user can click a button and select a PDF file name from a PDF on their local machine and then populate a form field with that file path & filename. The file names vary between all machines, so there is no static list. Note that the PDF is not embedded, nothing is executed, I simply need the file name.
There are several of these on a form (20+), so manual name entry is too error prone. I would like to use a 'browse' type dialog, but can not figure out how to implement it.
I've looked at app.browseForFile, but the users can not install a javascript file in their adobe folder or any other files; the functionality has to be integral with the original PDF.
Functionally, this is no different from the image object file browse, except that I need a PDF instead of an image file, so there doesn't seem like there should be a security issue that is any different from those surrounding the image object.
I've been stumped on this for the entire week, and I have a deadline rapidly approaching, so any examples or suggestions (please remember I'm a novice) would be greatly appreciated!Thanks for the reply Paul - do you have any sample code of how to attach the PDF? Or how the user can select a PDF to open? I might be able to attach it, retrieve the file name, and then un-attach it.
Alternatively, do you know how to retrieve the file name from the imagePath object? It will let you select PDF files, but I can't find info on how to retrieve the file name. It should be the way you would retrieve the file name for an image.
As a novice in this, thanks for your help and patience! -
CSOM code in C # to download and upload multiple files from/to sharepoint library
Hi All,
Please help me I want to first download all my files from sharepoint library to my local folder using CSOM code .
Once downloading is completed I want to upload those files in another library .
I have done same thing using web services but need to do by CSOM now.
Thanks please provide code of peice
sudhanshu sharma Do good and cast it into river :)By using below code I am downloading multiple documents and uploading same doc to sharepoint while uploading i want to updat emetadata of source library to destination library ..
I am able to do so but want to do now for dateandTime+metadata column as well please can you check my approach and let me know tht how to do for such kind of columns-
FileProperty.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ST_9569f2fe51bd4137bb31c38b3d46455d
class FileProperty
public string Title; //single line of text
public string Description; //Multiple line of text
public string DocumentType; //choice type
public string DocumentCategory; //Choice type
public string DocumentNumber; //Single line of text
// public string DocumentStatus; //Choice
public string DocumentTitle; //single line of text
// public string CrossReference; //Multipleline type
//public DateTime PublishDate; //DateAndTime Type column
/// <summary>
/// Get the SP Document Column internal name and thier respective values
/// in key -value pair.
/// </summary>
/// <returns>The List of KeyValuePair</returns>
public List<KeyValuePair<string, string>> getColumnKeyValueListProducts()
{//Target Columns
List<KeyValuePair<string, string>> columnKeyValuePairList = new List<KeyValuePair<string, string>>();
columnKeyValuePairList.Add(new KeyValuePair<string, string>("Title", Title));
columnKeyValuePairList.Add(new KeyValuePair<string, string>("Description0", Description));
columnKeyValuePairList.Add(new KeyValuePair<string, string>("Document_x0020_Type", DocumentType));
columnKeyValuePairList.Add(new KeyValuePair<string, string>("Document_x0020_Category", DocumentCategory));
columnKeyValuePairList.Add(new KeyValuePair<string, string>("Document_x0020_Number", DocumentNumber));
//columnKeyValuePairList.Add(new KeyValuePair<string, string>("Document_x0020_Status", DocumentStatus));
columnKeyValuePairList.Add(new KeyValuePair<string, string>("Document_x0020_Title", DocumentTitle));
//columnKeyValuePairList.Add(new KeyValuePair<string, string>("Cross%5Fx0020%5FReference", CrossReference));
// columnKeyValuePairList.Add(new KeyValuePair<string, string>("Publish_x0020_Date", PublishDate));
return columnKeyValuePairList;
/* public List<KeyValuePair<string, DateTime>> getColumnKeyValueListProductsforDatenTime()
//Target Columns
List<KeyValuePair<string, DateTime>> columnKeyValuePairListdt = new List<KeyValuePair<string, DateTime>>();
columnKeyValuePairListdt.Add(new KeyValuePair<string, DateTime>("Publish_x0020_Date", PublishDate));
return columnKeyValuePairListdt;
#region Help: Introduction to the script task
/* The Script Task allows you to perform virtually any operation that can be accomplished in
* a .Net application within the context of an Integration Services control flow.
* Expand the other regions which have "Help" prefixes for examples of specific ways to use
* Integration Services features within this script task. */
#endregion
#region Namespaces
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using Microsoft.SharePoint.Client;
using System.IO;
using System.Net;
using System.Collections.Generic;
//using System.IO;
#endregion
namespace ST_9569f2fe51bd4137bb31c38b3d46455d
/// <summary>
/// ScriptMain is the entry point class of the script. Do not change the name, attributes,
/// or parent of this class.
/// </summary>
[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
#region Help: Using Integration Services variables and parameters in a script
/* To use a variable in this script, first ensure that the variable has been added to
* either the list contained in the ReadOnlyVariables property or the list contained in
* the ReadWriteVariables property of this script task, according to whether or not your
* code needs to write to the variable. To add the variable, save this script, close this instance of
* Visual Studio, and update the ReadOnlyVariables and
* ReadWriteVariables properties in the Script Transformation Editor window.
* To use a parameter in this script, follow the same steps. Parameters are always read-only.
* Example of reading from a variable:
* DateTime startTime = (DateTime) Dts.Variables["System::StartTime"].Value;
* Example of writing to a variable:
* Dts.Variables["User::myStringVariable"].Value = "new value";
* Example of reading from a package parameter:
* int batchId = (int) Dts.Variables["$Package::batchId"].Value;
* Example of reading from a project parameter:
* int batchId = (int) Dts.Variables["$Project::batchId"].Value;
* Example of reading from a sensitive project parameter:
* int batchId = (int) Dts.Variables["$Project::batchId"].GetSensitiveValue();
#endregion
#region Help: Firing Integration Services events from a script
/* This script task can fire events for logging purposes.
* Example of firing an error event:
* Dts.Events.FireError(18, "Process Values", "Bad value", "", 0);
* Example of firing an information event:
* Dts.Events.FireInformation(3, "Process Values", "Processing has started", "", 0, ref fireAgain)
* Example of firing a warning event:
* Dts.Events.FireWarning(14, "Process Values", "No values received for input", "", 0);
#endregion
#region Help: Using Integration Services connection managers in a script
/* Some types of connection managers can be used in this script task. See the topic
* "Working with Connection Managers Programatically" for details.
* Example of using an ADO.Net connection manager:
* object rawConnection = Dts.Connections["Sales DB"].AcquireConnection(Dts.Transaction);
* SqlConnection myADONETConnection = (SqlConnection)rawConnection;
* //Use the connection in some code here, then release the connection
* Dts.Connections["Sales DB"].ReleaseConnection(rawConnection);
* Example of using a File connection manager
* object rawConnection = Dts.Connections["Prices.zip"].AcquireConnection(Dts.Transaction);
* string filePath = (string)rawConnection;
* //Use the connection in some code here, then release the connection
* Dts.Connections["Prices.zip"].ReleaseConnection(rawConnection);
#endregion
/// <summary>
/// This method is called when this script task executes in the control flow.
/// Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
/// To open Help, press F1.
/// </summary>
public void Main()
// TODO: Add your code here
//Unpublished lib used to download files from sharepoint to local and Published library for uploading files from local to sharepoint
//var srcFolderUrl = "http://ui3dats011x:2015/sites/techunits/UnPublished%20Doc/Forms/AllItems.aspx";
//var destFolderUrl = "http://ui3dats011x:2015/sites/techunits/Published%20Documents/Forms/AllItems.aspx";
using (var ctx = new ClientContext("http://ui3dats011x:2015/sites/techunits/"))
try
List LibraryName = ctx.Web.Lists.GetByTitle("Unpublished Doc");
List LibraryName1 = ctx.Web.Lists.GetByTitle("Published Documents");
ctx.Load(LibraryName1.RootFolder);
ctx.Load(LibraryName);
ctx.ExecuteQuery();
CamlQuery camlQuery = new CamlQuery();
//Used this caml query for filtering
camlQuery.ViewXml = @"<View><Query><Where><Eq><FieldRef Name='Document_x0020_Type'/><Value Type='Choice'>Technical Unit</Value></Eq></Where></Query></View>";
Microsoft.SharePoint.Client.ListItemCollection listItems = LibraryName.GetItems(camlQuery);
ctx.Load<Microsoft.SharePoint.Client.ListItemCollection>(listItems);
ctx.ExecuteQuery();
string filename;
FileInformation fileInfo;
System.IO.FileStream outputStream;
Dictionary<string, string> itemmetadata = new Dictionary<string, string>();
foreach (var item in listItems)
if (itemmetadata.Count > 0)
itemmetadata.Clear();
ctx.Load(item);
ctx.ExecuteQuery();
ctx.Load(item.File);
ctx.ExecuteQuery();
filename = item.File.Name;
foreach (KeyValuePair<string, object> metaval in item.FieldValues.)
string metavalue = Convert.ToString(metaval.Value);
//if(String.IsNullOrEmpty(metaval.Value.ToString()))
if (!(String.IsNullOrEmpty(metavalue)))
itemmetadata.Add(metaval.Key, metaval.Value.ToString());
else
itemmetadata.Add(metaval.Key, "");
fileInfo = Microsoft.SharePoint.Client.File.OpenBinaryDirect(ctx, item.File.ServerRelativeUrl.ToString());
outputStream = new FileStream(@"C:\Users\jainruc\Desktop\Sudhanshu\ComDownload\" + filename, FileMode.Create, FileAccess.Write);
fileInfo.Stream.CopyTo(outputStream);
outputStream.Dispose();
outputStream.Close();
//Uploading
string srcpath = @"C:\Users\jainruc\Desktop\Sudhanshu\ComDownload\";
string siteName = @"http://ui3dats011x:2015/sites/techunits/";
string docLibraryName = @"http://ui3dats011x:2015/sites/techunits/Published%20Documents/Forms/AllItems.aspx";
UploadFile(srcpath, siteName, docLibraryName, itemmetadata,filename);
}//End of try
catch (Exception ex)
Dts.TaskResult = (int)ScriptResults.Success;
public void UploadFile(string srcpath, string siteName, string docLibraryName,Dictionary<string,string> metavalue,string filename)
using (ClientContext ctx = new ClientContext("http://ui3dats011x:2015/sites/techunits/"))
try
List LibraryName1 = ctx.Web.Lists.GetByTitle("Published Documents");
ctx.Load(LibraryName1.RootFolder);
ctx.Load(LibraryName1);
ctx.ExecuteQuery();
ctx.Credentials = new NetworkCredential("jainfgfgh", "Pashg8878", "mydomain");
//Loop for getting all files one by one
using (var fs = new FileStream(String.Concat(srcpath,"/",filename), FileMode.OpenOrCreate))
string fileUrl = String.Format("{0}/{1}", LibraryName1.RootFolder.ServerRelativeUrl, filename);
Microsoft.SharePoint.Client.File.SaveBinaryDirect(ctx, fileUrl, fs, true);
UpdateMetadata(fileUrl,ctx,metavalue);
//End of looping
}//End of try block
catch (Exception ex)
}//End of Using
}//End of function
public void UpdateMetadata(string uploadedfileurl,ClientContext ctx,Dictionary<string,string> mvalue)
Microsoft.SharePoint.Client.File uploadedfile = ctx.Web.GetFileByServerRelativeUrl(uploadedfileurl);
//create an object of the class holding all the properties of the document
ctx.Load(uploadedfile);
ctx.ExecuteQuery();
FileProperty fileProperty = new FileProperty();
fileProperty.Description = mvalue["Description0"];
fileProperty.Title = mvalue["Title"];
fileProperty.DocumentType = mvalue["Document_x0020_Type"];
fileProperty.DocumentCategory = mvalue["DocumentCategory"];
fileProperty.DocumentNumber = mvalue["DocumentNumber"];
fileProperty.DocumentTitle = mvalue["DocumentTitle"];
//fileProperty.PublishDate = Convert.ToDateTime(mvalue["PublishDate"]);
// fileProperty.DocumentStatus = mvalue["DocumentStatus"];
List<KeyValuePair<string, string>> columnKeyValueList;
//create a list of item need to be updated or added to sharepoint library
List<FileProperty> propertyList = new List<FileProperty>();
propertyList.Add(fileProperty);
columnKeyValueList = fileProperty.getColumnKeyValueListProducts();
ListItem item = uploadedfile.ListItemAllFields;
foreach (KeyValuePair<string, string> metadataitem in columnKeyValueList)
item[metadataitem.Key.ToString()] = metadataitem.Value.ToString();
//item["Title"] = uploadedfile.Title;
item.Update();
ctx.Load(item);
ctx.ExecuteQuery();
#region ScriptResults declaration
/// <summary>
/// This enum provides a convenient shorthand within the scope of this class for setting the
/// result of the script.
/// This code was generated automatically.
/// </summary>
enum ScriptResults
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
#endregion
sudhanshu sharma Do good and cast it into river :) -
Help please to Upload a file from my PC to server's KM
Hello:
I can't Upload correctly a file from my local PC to a KM of the server.
My problem is after that I've uploaded any file from my PC to KM, sometimes when I open or download it from the KM appears blank, and when I try another way to write the file (out.write()) I've uploaded a bad file that can't be downloaded or opened it. I can't get the file Data of the file for uploading, I need to set it with the fileResource (I tried with fileResource.read(false))
I use a FileUpload in my view.
<b>My Context:</b>
File (node)
|----fileResource (com.sap.ide.webdynpro.uielementdefinitions.Resource)
|----fileData (binary)
|----fileName (String)
wdDoInit(){
IPrivateUploadDownloadKMView.IFileElement fileBind = wdContext.createFileElement();
wdContext.nodeFile().bind(fileBind);
IWDAttributeInfo attInfo = wdContext.nodeFile().getNodeInfo().getAttribute("fileData");
ISimpleTypeModifiable type = attInfo.getModifiableSimpleType();
onActionSubir(){
IPrivateUploadDownloadKMView.IFileElement fileElement = wdContext.currentFileElement();
IWDResource resource = fileElement.getFileResource();
fileElement.setFileName(resource.getResourceName());
fileElement.setFileData(fileData);
byte[] fileData=new byte[resource.read(false).available()];
fileElement.setFileData(fileData);
fileName = fileElement.getFileName();
try{
File file = new File(fileName);
FileOutputStream out = new FileOutputStream(file);
out.write(fileElement.getFileData());
out.close();
fin = new FileInputStream(fileName);
fin.read();
Content content = new Content(fin,null, -1);
IResource newResource = folder.createResource(fileElement.getFileName(),null, content);
catch(Exception e){
IWDMessageManager mm = wdControllerAPI.getComponent().getMessageManager();
mm.reportWarning("error: "+e.getMessage());
Can you help me?, any sugestions to solve my problem or improve my code?
Regards
Jonatan.If you have got the permission to access <b>content management</b> in portal appliction server consle,then click on content management >select the KM Repository and clik on it.Then right click on <b>folder</b>>new-->upload.After clicking the upload option one page will be open and then you can browse your local file and upload to the KM Repository.
-
Restoring selected files from a networked Time Machine backup
My wife's laptop logic board failed 2 days ago. It is backed up over our home network to a separate partition on a second hard drive in my MacPro. I'm trying to recover a few specific files from the day the machine failed.
When I try to mount her sparsebundle image, I get a message that the image could not be mounted "Reason -- not recognized".
Disk Utility claims the sparsebundle appears to be okay.
Using "Browse Other Time Machine Disks..." only shows the partition on the backup disk associated with my machine's backups.
Suggestions?I have found a way around the issue. My wife's user account on my machine is set up as Sharing Only (just so her Time Machine can write files to the backup drive). So I went to my daughter's machine, turned off her TM, disconnected daughter's machine from mine, and then reconnected from daughter's machine as my wife's username. Then I could mount my wife's sparsebundle on my daughter's machine.
DR -
How to write file in user's local desktop
Hi,
Using the WriteFile action, i can write the file in inetpub/wwwroot in server.
Is there any way to write the file in user's local drive folder?
Although now i am writing the file to server and allowing the user to access it through URL but I suspect that there could be user concurrent issue or file contamination issue.
Constraint - The file should open with the default name.
If i try to open a local copy to the user (thru SaveasCSV() or URL) and allow the user to save the copy then the default name appear as Illumniator.
Regards,
AnilI think your current approach of saving to the web location and providing the user access via URL is the best approach. From a security standpoint I can't see that writing directly to a user's desktop/laptop would be a good idea.
If you are worried about naming or concurrency issues, then create sub folders that match their user name, or devise a naming convention that allows the objects to be unique between users and purpose. -
Firefox crashes when uploading/downloading files from/to 'desktop folder'
Hello
I'm hoping, that you can help me!
I'm using Firefox 28.0 on MacBook Pro Mavericks 10.9.2
Firefox crashes/freezes when I try to upload/download files from/to my 'desktop folder'.
I't only happens, when I use this folder. Download to 'download folder' or any other folder works fine.
Download to 'desktop folder' when using Safari also works fine.
I't only happens when desktop and firefox tries to communicate.
It's very annoying when I accidentally forget, that the bugs is there, and I have to force quit and start all over again. And sometimes I don't even have a choice, because 'desktop' randomly opens as default folder, when I try to upload things.
Thank you so much in advance!
Kind regards ElizabethHi ESwan,
I am not a Mac user so not the best person to attempt to assist but here goes.
I am presuming that info such as
PID: 1695 Event: cpu usage (microstackshots only)
Relate to the Mac OS X crash & event logging and reporting.
What we need are the ones that Firefox itself generates and submits for processing by Mozilla Firefox
* See [[Firefox crashes - Troubleshoot, prevent and get help fixing crashes#w_get-help-fixing-this-crash]]'''#w_get-help-fixing-this-crash'''
From what you say the crashes occur after a certain action and I am hoping that you will be able to use the easy method as in the article linked above. Navigate to about:crashes by keying ''about:crashes'' into the address bar. You are loolking for the ones starting wth ''bp-'' Paste two or three of those into your next post. Include the bp- part but not any link information before that. After they are pasted into the forum the forum software changed them to be links. -
Urgent - Upload a file from Client to Server.
Need to load a file from the client machine to the Server running 9iAS Rel. 1 on a HP Unix Machine.
We are using Forms 6i. We have looked into the File Upload Utility demo code provided with Forms 6i - but have been unsuccessful in reusing it. PLS HELPDuplicate post.
Upload a file from client to server by forms in E-Bussiness Suite R12
Re: Upload a file from client to server by forms in E-Bussiness Suite R12. -
Error while uploading the file from Allpcation server in LSMW-7th step
Hi Experts,
what should be the specific CODE PAGE should be maintained while uploading the file from application server in LSMW-7th Step
Thanks in advance,
KSRHi
I mean that there is any seperate CODE PAGE which comes at the bottom of screen while uploading the file from the application server in 7th step.
Is there any specific CODE PAGE to be maintained...
Thanks in advance
Oarsk -
I installed an addon named Chat Resizer, which is for Kongregate, restarted to finish the install and firefox would not open.
Clicked it and clicked it nothing, Opened Task Manager, Ended the firefoxes and tried to open it again but nothing again.
Started FF in safe mode, cannot remove chat resizer with greasemonkey disabled, trying to enable it to remove it firefox refuses to start.
Uninstalled greasemonkey, FF works as normal, install it and it freezes once more.
Removed files from user/appdata/roaming/mozilla/profile blah blah/gm_scripts which had files for all of my scripts in them,
Firefox still won't start, uninstall greasemonkey, works again, install, doesnt work even with files for the scripts gone.
Any more suggestions?Hello,
I found this tutorial, i think must works:
[http://ooiks.com/blog/mousehunt-autobot/install-uninstall-user-script-on-firefox How to Install and Unistall User Scripts Greasemonkey] -
How to upload file from desktop or C drive and send as attachments
Hello Experts,
Please tell me
How to upload jpg or gif or drawing files from desktop or any drive and store into R/3 by the same time I have to send mail as a attachment.
I heard that FM
SO_NEW_DOCUMENT_ATT_SEND_API1 is only to send as a attachment what ever the data is present in the internal table only.
please help me on that.I m using this code its having attachment but I m not able to open the file. Please help me
I m using gui_upload to upload the file
PROGRAM ZTEST
no standard page heading line-size 255.
DATA: xfile TYPE string.
data : t_IW51 LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
data : email type table of BAPIADSMTP.
PARAMETERS : file LIKE rlgrap-filename OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
CLEAR file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = file.
xfile = file.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = xfile
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = t_IW51.
Creation of the document to be sent
File Name
DOC_CHNG-OBJ_NAME = 'SENDFILE'.
Mail Subject
DOC_CHNG-OBJ_DESCR = 'Send External Mail'.
Mail Contents
OBJTXT = 'Minimum bid : $250000'.
APPEND OBJTXT.
OBJTXT = 'A representation of the pictures up for auction'.
APPEND OBJTXT.
OBJTXT = 'was included as attachment.'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Creation of the document attachment
(Assume that the data in OBJBIN is in BMP format)
*OBJBIN = ' \O/ '. APPEND OBJBIN.
*OBJBIN = ' | '. APPEND OBJBIN.
*OBJBIN = ' / \ '. APPEND OBJBIN.
OBJBIN[] = t_IW51[].
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
OBJHEAD = 'PICTURE.PDF'.
APPEND OBJHEAD.
OBJBIN[] = t_IW51[].
Creation of the entry for the compressed attachment
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'PDF'.
OBJPACK-OBJ_NAME = 'PICTURE'.
OBJPACK-OBJ_DESCR = 'Representation of object 138'.
OBJPACK-DOC_SIZE = TAB_LINES * 255.
APPEND OBJPACK.
Completing the recipient list
RECLIST-RECEIVER = 'email_id have to enter here'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
RECLIST-RECEIVER = 'ENTEG01'.
RECLIST-REC_TYPE = 'P'.
APPEND RECLIST.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
commit_work = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
*EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
*OTHERS = 99.
CASE SY-SUBRC.
WHEN 0.
WRITE: / 'Result of the send process:'.
LOOP AT RECLIST.
WRITE: / RECLIST-RECEIVER(48), ':'.
IF RECLIST-RETRN_CODE = 0.
WRITE 'The document was sent'.
ELSE.
WRITE 'The document could not be sent'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'No authorization for sending to the specified number',
'of recipients'.
WHEN 2.
WRITE: / 'Document could not be sent to any recipient'.
WHEN 4.
WRITE: / 'No send authorization'.
WHEN OTHERS.
WRITE: / 'Error occurred while sending'.
ENDCASE.
Maybe you are looking for
-
Function module for getting starting day of a week form current data
Hi , Is there any function module that gives starting day of week when we give a particular date eg: today date is 19-12-2007 if i give this date as input i should get 16-12-2007 because this is starting day of this week .
-
Import external xml file in PDF using Livecycle
I require sending some values in main xml file from the external xml file during sending mail on button click. Doing so, I want to read values from external file into a hidden field or send the external xml/text file as an attachment. 1. Is there any
-
Restricting (Limiting) SQ01 access for a set of users
We are attempting to restrict a user so that they can run specific queries but not change them. We do not want to go into each query within a user group and lock the individual queries. We want to make this more global in that all users groups to wh
-
How to change short tip in PPR action.
Hi, I want to change a short tip in PPR action. I try to implement it by below code which in PFR method. But unfortunately, It's work fine in a environment, But get issue in another environment. +if ("Change".equals(pageContext.getParameter(OAWebBean
-
Smart Zoom in Safari with YouTube
Hello. I like the Smart Zoom feature that OS X and Safari has. It allows me to easily doubletap my mouse and Zoom in to whatever I want. I used to do it all the time when I watched YouTube clips, just doubletap and the clip is almost (but not) in ful