Upload files into apex using plsql

i use apex upload option to upload files in to flow_files. Now it has to be deon via PL/SQl process. Via PL/SQL Process the files has to be uploaded on to apex application flow files tables .
the data input to my application come not from same apex another but from extenal source via plsql procedure.
is it possible ?
thanks
Raj

Just for completeness ...
Got this to work, but it's a pl/sql issue as opposed to an APEX issue.
Anyway, if anyone needs to have the ability to read multiple files then a quick easy way to do it (as lomg as they know the file names that will be read), is to create a directory on the database which points to the actual harddrive on your PC, then create a table (called an external table) and read from that external table as if it was an actual database table ...
1 - Log on as sys and grant CREATE ANY DIRECTORY to whatever user you are logging in as (assuming you are not using sys to create apps)
2 - Create a directory e.g....CREATE OR REPLACE DIRECTORY GB_TEST AS 'c:\gbtest';
3 - Create an external table as ...
CREATE TABLE gb_test
(file_name varchar2(10),
rec_date date
rec_name VARCHAR2(20),
rec_age number,
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER
DEFAULT DIRECTORY GB_TEST
ACCESS PARAMETERS
RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY ','
LOCATION ('data1.csv','data2.csv','data3.csv','data4.csv')
PARALLEL 5
REJECT LIMIT 20000;
That's it then ...
select * from gb_test
where file_name = 'xxx'
will return all the data where the file_name = 'xxx'
very easy to use.

Similar Messages

  • Security Issues with uploading files into APEX - How is anti-virus handled?

    Hi APEXers!
    We have been using APEX 3 for some time and are now migrating to APEX 4. We have a request for a new application that will require uploading spreadsheets. From other developers, I know it can be done in a few ways. The only thing we have done before is limitied - storing them in BLOBs.
    With the Websheets in APEX 4, users could load them directly into the database.
    But the anti-virus issue has always been unclear. For the apps that we are allowing to upload to BLOBs, they are small user, internal apps so we hope that our enterprise desktop software will stop a bad file before it gets uploaded.
    We have gotten some questions about allowing outside-our-network people to upload spreadsheets or maybe even the public. So far, our security people have just said no - but I wondered what everyone else is doing?
    Are there any White Papers or articles on this? My general impression is that anti-virus software has to be installed at the server level to deal with this.
    If anyone can provide some guidance, I would appreciate it as I have to figure out what to tell the development team requesting to do this.

    Do you have to take excel format? CSV would be a lot safer.
    You might take inspiration from this:
    http://stackoverflow.com/questions/3363767/how-do-you-virus-scan-a-file-being-uploaded-to-your-java-webapp-as-it-streams

  • Upload file into KM using Web Dynpro ABAP

    Hi, I'm looking at converting an existing Web Dynpro Java application to a Web Dynpro ABAP application. However, I cannot find how to upload a file and store it in the Portal KM repository using WDA. I have been able to do it successfully using WDJ. Any help on how to do this would be very much appreciated. Thanks.

    Hi, I'm looking at converting an existing Web Dynpro Java application to a Web Dynpro ABAP application. However, I cannot find how to upload a file and store it in the Portal KM repository using WDA. I have been able to do it successfully using WDJ. Any help on how to do this would be very much appreciated. Thanks.

  • How to upload a file into server using j2ee jsp and servlet with bean?

    How to upload a file into server using j2ee jsp and servlet with bean? Please give me the reference or url about how to do that. If related to struts is more suitable.
    Anyone help me please!

    u don't need j2ee and struts to do file uploading. An example is as such
    in JSP. u use the <input> file tag like
    <input type="file"....>You need a bean to capture the file contents like
    class FileUploadObj {
        private FormFile srcFile;
        private byte[] fileContent;
        // all the getter and setter methods
    }Then in the servlet, you process the file for uploading
        * The following loads the uploaded binary data into a byte Array.
        FileUploadObj form = new FileUploadObj();
        byte[] byteArr = null;
        if (form.signFile != null) {
            int filesize = form.srcFile.getFileSize();
            byteArr = new byte[filesize];
            ByteArrayInputStream bytein = new ByteArrayInputStream (form.srcFile.getFileData());
            bytein.read(byteArr);
            bytein.close();
            form.setFileContent(byteArr);
        // Write file content using Writer class into the destination file in the server.
        ...

  • Someone used upload files into blob in JDeveloper 10.1.3.2 ?

    Someone used upload files into blob in JDeveloper 10.1.3.2 ?
    I used Steve Muech example 85, but after downloading , downloaded files doesn't work ?
    I prepared test case http://www.sttb.pl/jakub/UploadAndDownloadBlob.zip - meybe someone resolve it.
    Regards
    Kuba

    Hi,
    There is no problem with download in above example. I have used Steve's example to upload, and solution delivered by Ric Smith on his blog to download files. I think there is something wrong with Steve's uploading solution. When I used Ric solution (he sent me by email complete JDeveloper project) to upload and download everyting works correct. I created last Friday SR on Metalink to review it and it's still in progress. My advice is:
    1) Look onto Ric Smith blog:
    http://thepeninsulasedge.com/blog/2006/08/17/reading-and-writing-blobdomains-to-and-from-an-adf-uploadfile/
    and
    http://thepeninsulasedge.com/blog/2006/11/06/adf-faces-and-adf-bc-fileupload-and-blobs-continued/
    2) Ask him to send JDeveloper project or update email to your profile - I'll send you directly this project that I retrieved from Ric Smith
    Regards
    Kuba

  • Access denied. When trying to upload files into SharePoint with PowerShell

    AM trying to upload a bunch of files into SharePoint using PowerShell. I have a code that works on my local machine, but when I get on the server, it does not. Here is what my block of code looks like
    $webUrl = "http://SampleSite"
    $libraryName = "My Lib"
    $docLibraryUrlName = "My%20ContentType"
    $fileLocation = "C:\test\"
    $contentType = "My ContentType"
    #Open web and library
    $web = Get-SPWeb $webUrl
    $docLibrary = $web.Lists[$libraryName]
    $files = ([System.IO.DirectoryInfo] (Get-Item $fileLocation)).GetFiles()
    ForEach($file in $files)
    #Open file
    $fileStream = ([System.IO.FileInfo] (Get-Item $file.FullName)).OpenRead()
    # Gather the file name
    $FileName = $File.Name
    #remove file extension
    $NewName = [IO.Path]::GetFileNameWithoutExtension($FileName)
    #split the file name by the "-" character
    $FileNameArray = $NewName.split("_")
    #Add file
    #$folder = $web.getfolder($docLibraryUrlName)
    $folder = $web.getfolder($docLibrary)
    write-host "Copying file " $file.Name " to " $folder.ServerRelativeUrl "..."
    $spFile = $folder.Files.Add($folder.Url + "/" + $File.Name, $fileStream, $true)
    $spItem = $spFile.Item
    #populate metadata
    $spItem["First Column"] = $FileNameArray[0]
    $spItem["Second Column"] = $FileNameArray[1]
    $spItem.Update()
    $fileStream.Close();
    Again, this code works fine on my local machine but doesn't when I move this to the server. When I step through the code, I noticed that when I look at the data returned for my $folder variable in this snippet
    $folder = $web.getfolder($docLibrary)
    It shows the EffectiveRawPermissions to be "Open, BrowseUserInfo, UserClientIntegration" on the server...however, the EffectiveRawPermissions on my local machine is "FullMask". Does this have any effect on the ability of my code to be
    able to upload the files into SP on the server? I have never run into this issue, so am not sure how this makes sense...so I really appreciate any insight. Thanks
    I am getting this error when the code attempts to perform the "Add" function...
    Exception calling "Add" with "3" argument(s): "<nativehr>0x80070005</nativehr><nativestack></nativestack>Access denied."
    At C:\PowerShellScripts\tester.ps1:70 char:3
    +         $spFile = $folder.Files.Add($folder.Url + "/" + $File.Name, $fileStream, $true ...
    +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : UnauthorizedAccessException
     ...Please help

    RunWithElevatedPriv basically impersonates the webapp's app pool account, which should have full control over the entire webapp... this would work, but is not recommended for several reasons:
    - first and foremost, you shouldn't NEED to bypass the SP security model
    - second and still important, the app pool may be hosting other webapps as well, so the risk of a bug causing security-related problems within the RunWithElev codeblock is no longer scoped to the current webapp, but also other webapps that share the same
    app pool account.
    - third, same as number two, but for service accounts, and possibly even the farm... not a good practice, but a lot of SP installs aren't configured correctly, so the entire farm may be using one account... now, the RunWithElev is not just a webapp admin,
    not just a multiple webapp admin, but may be able to affect service apps, or possibly the entire farm.
    - fourth, the audit info (created by, modified by) will reference the system account, instead of your account... not a very accurate audit trail in that case.
    If you have a legit need to add the files, you should be able to get the necessary permissions (which is basically just contribute within the library / folder) easily enough.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • How to upload data into IT0000 using ABAP-HR program

    Hello,
    I'm required to upload data into multiple infotypes [IT000, 0001, 0002, etc] using single input text file. Can anyone able to guide me, how to upload data into IT0000 using ABAP program ?
    Thanks in advance.
    Regards
    Prabhakar.
    Message was edited by:
            Prabhakara Muthyal

    Example code for HR_MAINTAIN_MASTERDATA to COPY IT0002
    DATA: INT_0002_FINAL TYPE STANDARD TABLE OF PA0002 WITH HEADER LINE.
    DATA: VALUES        LIKE PPROP OCCURS 10 WITH HEADER LINE,
    RETURN        LIKE BAPIRETURN1,.
    LOOP AT INT_0002_FINAL.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-PERNR'.
          VALUES-FVAL  = INT_0002_FINAL-PERNR.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-BEGDA'.
          VALUES-FVAL  = INT_0002_FINAL-BEGDA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-ENDDA'.
          VALUES-FVAL  = INT_0002_FINAL-ENDDA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-nachn'.
          VALUES-FVAL  = INT_0002_FINAL-NACHN.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-gblnd'.
          VALUES-FVAL  = INT_0002_FINAL-GBLND.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-vorna'.
          VALUES-FVAL  = INT_0002_FINAL-VORNA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-rufnm'.
          VALUES-FVAL  = INT_0002_FINAL-RUFNM.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-name2'.
          VALUES-FVAL  = INT_0002_FINAL-NAME2.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-inits'.
          VALUES-FVAL  = INT_0002_FINAL-INITS.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-famst'.
          VALUES-FVAL  = INT_0002_FINAL-FAMST.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-gbdat'.
          VALUES-FVAL  = INT_0002_FINAL-GBDAT.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-sprsl'.
          VALUES-FVAL  = INT_0002_FINAL-SPRSL.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-anzkd'.
          VALUES-FVAL  = INT_0002_FINAL-ANZKD.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-natio'.
          VALUES-FVAL  = INT_0002_FINAL-NATIO.
          APPEND VALUES.
    * maintain master data
          CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
            EXPORTING
              PERNR           = INT_0002_FINAL-PERNR
              ACTIO           = 'COP'
              BEGDA           = INT_0002_FINAL-BEGDA
    *         ENDDA           = INT_0002_FINAL-ENDDA
              SUBTY           = SPACE
              NO_ENQUEUE      = SPACE
              DIALOG_MODE        = '0'
              TCLAS              = 'A'
            IMPORTING
              RETURN1         = RETURN
            TABLES
              PROPOSED_VALUES = VALUES
    *         MODIFIED_KEYS   =
            EXCEPTIONS
              OTHERS          = 1.
          IF RETURN IS INITIAL.
            WRITE:/' Done....'.
          ELSE.
            WRITE:/   RETURN-ID, RETURN-TYPE, RETURN-NUMBER, RETURN-MESSAGE_V1, RETURN-MESSAGE_V2, RETURN-MESSAGE_V3, RETURN-MESSAGE_V4.
          ENDIF.
          CLEAR VALUES.
          REFRESH VALUES.
        ENDLOOP.

  • Problems with uploading file to database using FND_GFM

    Hi
    I'm having some problems uploading files to the database in apps 11.5.9
    As various sources/documents tell me, using the standard FND_GFM / FND_FILE_UPLOAD packages of APPS should transfer an uploaded file into the FND_LOBS table, but some reason it doesn't work. I copied and altered the FND_GFM.upload_confirm function to try and figure out why it doesn;t work and it looks like the file to be uploaded does not appear in the defined table (FND_LOBS_DOCUMENT).
    The following DAD is defined (with hidden password and servername to prevent abuse ;)):
    [DAD_oes_s]
    connect_string = oes_s
    password = ****
    username = APPS
    default_page = fnd_web.ping
    document_table = APPS.fnd_lobs_document
    document_path = docs
    document_proc =
    upload_as_long_raw =
    upload_as_blob = *
    reuse = Yes
    connmax = 10
    pathalias = fndgfm
    pathaliasproc = fnd_gfm.dispatch
    enablesso = No
    cgi_env_list=SERVER_NAME=***,REQUEST_PROTOCOL=http,SERVER_P
    ORT=***,HOST=***
    input_filtering = Yes
    stateful=STATELESS_RESET
    And I'm using the following code to generate the upload-file page
    CREATE OR REPLACE PROCEDURE XX_ITRIS_HelloWorld AS--(file IN VARCHAR2) AS
         access_id_v varchar2(1000);
         BEGIN
              htp.htmlOpen;
              htp.bodyOpen;
              htp.formOpen('http://***/pls/oes_s/fnd_file_upload.uploadcompletemessage', 'GET', null, 'multipart/form-data');
              htp.formFile('file');
              access_id_v := fnd_gfm.authorize(null);
              htp.formHidden('access_id', access_id_v);
              htp.formSubmit();
              htp.formClose;
              htp.line;
              htp.bodyClose;
              htp.htmlClose;
         END XX_ITRIS_HelloWorld;
    Can anybody point out what is going wrong?

    You said you are uploading XML file whereas in the TSQL you have assign as text file i.e @SourceFile = 'test.txt'. Are you sure that you are copying XML file ? What is the size of the source file "test.txt" ? I am sure it is 0 KB. That is what you
    have found in FTP site.
    Regards, RSingh

  • Hi, I am using HP11 and iPlanet web server. When trying to upload files over HTTP using FORM ENCTYPE="multipart/form-data" that are bigger than a few Kilobytes i get a 408 error. (client timeout).

    Hi, I am using HP11 and iPlanet web server. When trying to upload files over HTTP using FORM ENCTYPE="multipart/form-data" that are bigger than a few Kilobytes i get a 408 error. (client timeout). It is as if the server has decided that the client has timed out during the file upload. The default setting is 30 seconds for AcceptTimeout in the magnus.conf file. This should be ample to get the file across, even increasing this to 2 minutes just produces the same error after 2 minutes. Any help appreciated. Apologies if this is not the correct forum for this, I couldn't see one for iPlanet and Web, many thanks, Kieran.

    Hi,
    You didnt mention which version of IWS. follow these steps.
    (1)Goto Web Server Administration Server, select the server you want to manage.
    (2)Select Preference >> Perfomance Tuning.
    (3)set HTTP Persistent Connection Timeout to your choice (eg 180 sec for three minutes)
    (4) Apply changes and restart the server.
    *Setting the timeout to a lower value, however, may    prevent the transfer of large files as timeout does not refer to the time that the connection has been idle. For example, if you are using a 2400 baud modem, and the request timeout is set to 180 seconds, then the maximum file size that can be transferred before   the connection is closed is 432000 bits (2400 multiplied by 180)
    Regards
    T.Raghulan
    [email protected]

  • Error while uploading file into KM

    Hi Experts,
    I m getting error while uploading file into KM. Its throwing an error message like " Syngenta-POC.doc" does not exist, or file is empty; you cannot upload empty files"
    please assists me.

    Shantanu,
    Please check the files which you are upload is empty or unknown format. If everything seems valid then try to check for the corresponding SAP Note in service.sap.com
    Ram

  • Setting Font for converting multiple text files into PDF using VB 6.0

    Dear All,
    Am converting multiple text files into PDF using VB6.0. Currently, am unable to control the font face and size for the generated files. Below is the procedure am using for each file;
    Public Sub proc_convert_to_PDF(srcFilename As String, destFilename As String)
    Dim p_AcroApp As CAcroApp
    Dim p_VDoc As CAcroAVDoc
    Dim p_DDoc As CAcroPDDoc
    Dim IsOk As Boolean
    Set p_AcroApp = CreateObject("AcroExch.App")
    Set p_VDoc = CreateObject("AcroExch.AVDoc")
    Call p_VDoc.Open(srcFilename, "")
    Set p_VDoc = p_AcroApp.GetActiveDoc
    If p_VDoc.IsValid Then
    Set p_DDoc = p_VDoc.GetPDDoc
    ' Fill in pdf properties.
    p_DDoc.SetInfo "Title", Format(Date, "dd-mm-yyy")
    p_DDoc.SetInfo "Subject", srcFilename
    If p_DDoc.Save(1 Or 4 Or 32, destFilename) <> True Then
    MsgBox "Failed to save " & srcFilename
    End If
    p_DDoc.Close
    End If
    'Close the PDF
    p_VDoc.Close True
    p_AcroApp.Exit
    'Clear Variables
    Set p_DDoc = Nothing
    Set p_VDoc = Nothing
    Set p_AcroApp = Nothing
    End Sub
    What I need;
    1) to be able to set the font face of the destination file ( destFilename)
    2) to be able to set the font size of the destination file ( destFilename)
    Am using Adobe Acrobat 7.0 Type Library
    Kindly Help.
    Thanks in advance

    We didn't say it doesn't work. We said it isn't supported.
    There are a number of other ways to make a PDF. The one which would
    give the most control is if your application directly printed to GDI,
    controlling the font directly. This could print to Adobe PDF.
    You could look for an application that gives control of font for
    printing.
    You could use a text-to-PostScript system and distill the result. You
    could even look for a non-Adobe text-to-PDF.
    Working in the unsupported and dangerous world you chose, the font
    size for text conversion is set (and this is very bad design from
    Adobe) in the settings for Create PDF > From Web Page. There is no API
    to this.
    Aandi Inston

  • Upload file in KM using webdynpro without portal.

    Hi Experts,
    Can we upload files in KM using webdynpro without portal ? If  it is possible then please give the whole step by step process? Please reply....its urgent...
    I am very new in webDynpro...
    Thanks
    Regards
    Nutan Champia

    Hi
    Go through this
    <a href="/people/rohit.radhakrishnan/blog/2005/05/27/uploading-files-to-km-repository-using-webdynpro-apis
    also you can see this
    <a href="/thread/452368 [original link is broken]
    Regards
    Abhijith YS

  • After uploading file in BLOB using webutil file on system locked?

    I uploaded file in BLOB using webutil upload utility. But after uploading it locks the file and i cannot delete the file unless i close the iexplorer window.
    Is there any way to unlock the file and delete it with out closing the application(iexplorer). If any body knows please reply.
    Regards,
    Muhammad Qazzafi

    can you post the statements, which you use for the upload ?
    thx
    Gerd

  • Issue with permissions to upload files into Apache web server to OS 10.8.2

    Hello everyone;
    I setted up Apache web server and mysql to OS 10.8.2 Mountain Lion. It's working fine except for the permissions. I can't upload files into the web site directory. Doesn't recognize, e.g., the PHP function "move_uploaded".
    One problem for my is that I can't modify the permissions by "Terminal" app since it telling me that the "Process completed" and I can't write any script.
    Any suggestion will be welcome.
    Thanks in advance.

    My only question now would be how to speed up Safari's 6.0.1 performance in 10.8.2 or do I just accept that it's a little slower than it was, which is fine. Are other folks having this issue?
    I was primarily passing along info about my particular download speed and for the Web Confidential 3.8 people: make a backup of your passwords b4 installing 10.8.2 or be prepared to upgrade.

  • Convert XML file into DTD using Java

    Hi All,
    I want to do convert the xml file into DTD using Java.
    I read the DOM package but didnt get clear idea.
    Anyone of you have an idea please share the coding with me.
    Any suggestions greatly appreciated.
    Thanks
    Veera

    Hi All,
    I want to do convert the xml file into DTD using Java.
    I read the DOM package but didnt get clear idea.
    Anyone of you have an idea please share the coding with me.
    Any suggestions greatly appreciated.
    Thanks
    Veera

Maybe you are looking for

  • Itunes wont install windows 7

    I have windows 7, I've been able to download the latest itunes verstion but can't install it.  I've tried running as administrator and multiple other fixes to no avail.  Is there anything that I can do?

  • How do you make a new PDF preset in pages?

    I had a very embarrassing pages moment today. A price list for my artwork went out a 10mb when exported from pages at the medium setting. The source images are from the media browser- from my aperture library. I know I am an idiot for not checking bu

  • SELECT-CASE in query

    I have not used queries which use 'SELECT-CASE' but i have seen a query like as below:- SELECT /*+ rule */ SUM(CASE WHEN age <= 15 THEN cnt ELSE 0 END) "upto 15 Years" , SUM(CASE WHEN age >= 16 AND age <= 20 THEN cnt ELSE 0 END) "16-20 Years" , SUM(C

  • Can I use my iPad when it is charging

    Can I use my iPad when it is charging without hurting the battery?

  • Mail for Exchange outlook not syncing all calendar...

    Hi, Nokia E6 Anna using mail for exchange to sync outlook.com/hotmail calendar. Recently switched phone so would like my entire outlook.com calendar to appear on E6. I added mail for exchange hotmail account to phone selecting email, calendar and con