Want to upload file using shell

Hello I'm making a dialog box with 2 tasks : 1 is download / second is upload.
The download part (first button) works but I need help with the upload part because the shell is downloading. The downloads_Folder is to much at the upload part... (set downloads_Folder to quoted form of POSIX path of "Users:X:Desktop:PRINT" too)
Can I get some help on this please. Thanks in advance.
Here is my code:
display dialog "DO MY THING" buttons {"DOWNLOAD", "UPLOAD", "Cancel"} cancel button "Cancel"
--First button reply and then action
if button returned of result is "DOWNLOAD" then
display dialog ("START DOWNLOAD") buttons {"OK", "Cancel"} cancel button "Cancel"
set user_name to "XXX"
set pass_word to "XXX"
set domain_Name to "XXX"
set downloads_Folder to quoted form of POSIX path of "Users:X:Desktop:PRINT"
do shell script ("mkdir -p " & downloads_Folder & "; cd " & downloads_Folder & "; /usr/bin/ncftpget -R ftp://" & user_name & ":" & pass_word & "@" & domain_Name)
display dialog ("Downloaden is ready") buttons {"DID DONE"} cancel button "DID DONE"
else
--2 button reply and then action from here need help
if button returned of result is "UPLOAD" then
display dialog ("START UPLOAD") buttons {"OK", "Cancel"} cancel button "Cancel"
tell application "Finder" to choose file
set user_name to "xxx"
set pass_word to "xxx"
set domain_Name to "xxx"
set downloads_Folder to quoted form of POSIX path of "Users:X:Desktop:PRINT"
do shell script ("mkdir -p " & downloads_Folder & "; cd " & downloads_Folder & "; /usr/bin/ncftpget -R ftp://" & user_name & ":" & pass_word & "@" & domain_Name)
display dialog ("UPLOAD FINISHED") buttons {"DID DONE"} cancel button "DID DONE"
end if
end if
Message was edited by: Colin @ mac.com

property dFolder : "~/Desktop/downloads_Folder" -- Full path of 'downloads_Folder' folder.
property user_name : "xxx"
property pass_word : "xxx"
property domain_Name : "xxx"
property remote_dir : "/" -- Directory of remote site, to place uploaded file(s) to.
set tResult to button returned of (display dialog "Receive / Send files" buttons {"Download", "Upload", "Cancel"} cancel button 3 default button 1)
-- First button reply and then action
if (tResult is equal to "Download") then
display dialog ("Start download") buttons {"Cancel", "OK"} default button 2
with timeout of 0 seconds -- Extends AppleScripts' timeout period indefinitly.
do shell script ("mkdir -p " & dFolder & "; cd " & dFolder & "; /usr/bin/ncftpget -R ftp://" & user_name & ":" & pass_word & "@" & domain_Name)
end timeout
display dialog ("Download completed") buttons {"OK"} default button 1
-- Second button reply and then action
else if (tResult is equal to "Upload") then
display dialog ("Start upload") buttons {"Cancel", "OK"} default button 2
set tFiles to choose file with multiple selections allowed without invisibles -- See 'StandardAdditions.osax' library dictionary.
set {fName, fCount} to {"", count tFiles}
repeat with i from 1 to fCount
tell application "Finder" to set fName to fName & (quoted form of POSIX path of ((item i of tFiles) as string))
if (i < fCount) then set fName to fName & " "
end repeat
with timeout of 0 seconds -- Extends AppleScripts' timeout period indefinitly.
do shell script ("/usr/bin/ncftpput -R -u " & user_name & " -p " & pass_word & " " & domain_Name & " " & remote_dir & " " & fName)
end timeout
display dialog ("Upload completed") buttons {"OK"} default button 1
end if

Similar Messages

  • How to upload file using  *cl_gui_frontend_services* method

    hi
    i want to upload an image file using this method
    and i want to save it in MIME Repository (/SAP/BC/BSP/SAP/PRASHANT)
    DATA:
    itab TYPE TABLE OF sflight.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = 'C:\temp\winter.jpg'
        filetype                = 'ASC'
        has_field_separator     = '|'
      CHANGING
        data_tab                = itab
    IF sy-subrc = 0.
    WRITE:/ 'success'.
    ENDIF.
    So plz tel me how i set given path to upload file using this method .

    Hi Prashant,
    Go through the [Link|https://forums.sdn.sap.com/click.jspa?searchID=24477690&messageID=6684222].
    Hope this is helpful.
    Regards,
    Abhinav

  • How to get ORA errors in alertlog file using shell script.

    Hi,
    Can anyone tell me how to get all ORA errors between two particular times in an alertlog file using shell script.
    Thanks

    Hi,
    You can define the alert log as an external table, and extract messages with SQL, very cool:
    http://www.dba-oracle.com/t_oracle_alert_log_sql_external_tables.htm
    If you want to write a shell script to scan the alert log, see here:
    http://www.rampant-books.com/book_2007_1_shell_scripting.htm
    #!/bin/ksh
    # log monitoring script
    # report all errors (and specific warnings) in the alert log
    # which have occurred since the date
    # and time in last_alerttime_$ORACLE_SID.txt
    # parameters:
    # 1) ORACLE_SID
    # 2) optional alert exclusion file [default = alert_logmon.excl]
    # exclude file format:
    # error_number error_number
    # error_number ...
    # i.e. a string of numbers with the ORA- and any leading zeroes that appear
    # e.g. (NB the examples are NOT normally excluded)
    # ORA-07552 ORA-08006 ORA-12819
    # ORA-01555 ORA-07553
    BASEDIR=$(dirname $0)
    if [ $# -lt 1 ]; then
    echo "usage: $(basename) ORACLE_SID [exclude file]"
    exit -1
    fi
    export ORACLE_SID=$1
    if [ ! -z "$2" ]; then
    EXCLFILE=$2
    else
    EXCLFILE=$BASEDIR/alert_logmon.excl
    fi
    LASTALERT=$BASEDIR/last_alerttime_$ORACLE_SID.txt
    if [ ! -f $EXCLFILE ]; then
    echo "alert exclusion ($EXCLFILE) file not found!"
    exit -1
    fi
    # establish alert file location
    export ORAENV_ASK=NO
    export PATH=$PATH:/usr/local/bin
    . oraenv
    DPATH=`sqlplus -s "/ as sysdba" <<!EOF
    set pages 0
    set lines 160
    set verify off
    set feedback off
    select replace(value,'?','$ORACLE_HOME')
    from v\\\$parameter
    where name = 'background_dump_dest';
    !EOF
    `
    if [ ! -d "$DPATH" ]; then
    echo "Script Error - bdump path found as $DPATH"
    exit -1
    fi
    ALOG=${DPATH}/alert_${ORACLE_SID}.log
    # now create awk file
    cat > $BASEDIR/awkfile.awk<<!EOF
    BEGIN {
    # first get excluded error list
    excldata="";
    while (getline < "$EXCLFILE" > 0)
    { excldata=excldata " " \$0; }
    print excldata
    # get time of last error
    if (getline < "$LASTALERT" < 1)
    { olddate = "00000000 00:00:00" }
    else
    { olddate=\$0; }
    errct = 0; errfound = 0;
    { if ( \$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
    { if (dtconv(\$3, \$2, \$5, \$4) <= olddate)
    { # get next record from file
    next; # get next record from file
    # here we are now processing errors
    OLDLINE=\$0; # store date, possibly of error, or else to be discarded
    while (getline > 0)
    { if (\$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
    { if (errfound > 0)
    { printf ("%s<BR>",OLDLINE); }
    OLDLINE = \$0; # no error, clear and start again
    errfound = 0;
    # save the date for next run
    olddate = dtconv(\$3, \$2, \$5, \$4);
    continue;
    OLDLINE = sprintf("%s<BR>%s",OLDLINE,\$0);
    if ( \$0 ~ /ORA-/ || /[Ff]uzzy/ )
    { # extract the error
    errloc=index(\$0,"ORA-")
    if (errloc > 0)
    { oraerr=substr(\$0,errloc);
    if (index(oraerr,":") < 1)
    { oraloc2=index(oraerr," ") }
    else
    { oraloc2=index(oraerr,":") }
    oraloc2=oraloc2-1;
    oraerr=substr(oraerr,1,oraloc2);
    if (index(excldata,oraerr) < 1)
    { errfound = errfound +1; }
    else # treat fuzzy as errors
    { errfound = errfound +1; }
    END {
    if (errfound > 0)
    { printf ("%s<BR>",OLDLINE); }
    print olddate > "$LASTALERT";
    function dtconv (dd, mon, yyyy, tim, sortdate) {
    mth=index("JanFebMarAprMayJunJulAugSepOctNovDec",mon);
    if (mth < 1)
    { return "00000000 00:00:00" };
    # now get month number - make to complete multiple of three and divide
    mth=(mth+2)/3;
    sortdate=sprintf("%04d%02d%02d %s",yyyy,mth,dd,tim);
    return sortdate;
    !EOF
    ERRMESS=$(nawk -f $BASEDIR/awkfile.awk $ALOG)
    ERRCT=$(echo $ERRMESS|awk 'BEGIN {RS="<BR>"} END {print NR}')
    rm $LASTALERT
    if [ $ERRCT -gt 1 ]; then
    echo "$ERRCT Errors Found \n"
    echo "$ERRMESS"|nawk 'BEGIN {FS="<BR>"}{for (i=1;NF>=i;i++) {print $i}}'
    exit 2
    fi

  • Problem in upload file using oreilly classes

    Hi
    I stucked on a problem......
    I want to upload file from html page....On this page I want only a upload button so that when I click on this button file will upload from my client m/c to server m/c....
    I have code n all but browse button on html page....now I want to remove this browse button n want to give the file path somewhere in the code itself........so that on html page there will only the uplod button and by click on this button file will upload from client to server.......server path already there in code.....Please do the needful
    Abhishek
    I m putting the code here:-
    FileUpload.java
    upload-FileUpload.java
    NOTE: This file is a generated file.
    Do not modify it by hand!
    package upload;
    //custom imports for FileUpload
    //add your custom import statements here
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import com.oreilly.servlet.MultipartRequest;
    import java.util.*;
    public class FileUpload extends javax.servlet.http.HttpServlet
         protected boolean create() throws java.lang.Exception
              return true;
         public FileUpload()
         {   // Constructor.
         private void unhandledEvent( String listenerName, String methodName, java.lang.Object event )
         * destroy Method
         public void destroy()
              super.destroy();
              // TODO: implement
         * doGet Method
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              System.out.println("abhishek");
              response.setContentType( "text/html" );
              PrintWriter out = response.getWriter();
              out.println("<HTML>");
              out.println("<HEAD><TITLE>FileUpload</TITLE></HEAD>");
              out.println("<BODY>");
              out.println("<H1>FileUpload</H1>");
              out.println("Hello World!");
              out.println("<P>Default Implementation From PowerJ</P>");
              out.println("</BODY></HTML>");
              // TODO: implement
         * doPost Method
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              PrintWriter out = response.getWriter();
              try{
                   response.setContentType("text/html");
                   out.println("<HTML>");
                   out.println("<head><Title>Decoded Uploaded File</title><head>");
                   out.println("<body>");
                   out.println("<H1>UploadFile</h1>");
                   // path must be absolute to upload dir
                   // This is the decoder class that extracts the parameters and transfer file
                   // request argument = Http input stream
                   // c:\\temp\\upload = directory to save file
                   // 15*1024*1024 = 15mb max size file
                   MultipartRequest multi = new MultipartRequest(request, "c:\\temp\\upload",15*1024*1024);
                   // Lists form parameters
                   out.println("Params:");
                   Enumeration params = multi.getParameterNames();
                   out.println("<pre>");
                   while (params.hasMoreElements()) {
                        String name = (String)params.nextElement();
                        String value = multi.getParameter(name);
                        out.println(name + " = " + value);
                   out.println("</pre>");
                   // Show details of uploaded file
                   out.println("Files:");
                   Enumeration files = multi.getFileNames();
                   out.println("<pre>");
                   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("f.toString(): " + f.toString());
                             out.println("f.getName(): " + f.getName());
                             out.println("f.exists(): " + f.exists());
                             out.println("f.length(): " + f.length());
                             out.println();
                        out.println("</pre>");
              }catch (Exception e){
                   out.println("<pre>");
                   e.printStackTrace(out);
                   out.println("</pre>");
              out.println("</body></html>");
         * init Method
         public void init(ServletConfig config) throws ServletException
              super.init(config);
              // TODO: implement
         * data members
    //     add your data members here
    UploadFile.html
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>File Upload using EAS</title>
    </head>
    <body>
    <form method="POST" enctype="multipart/form-data" action="upload/FileUpload">
    <p><b>File Upload using EAS </b></p>
    <p>Select file to send: <input type="file" name="name" size="30"></p>
    <p>Your Name: <input type="input" name="yourname" size="20"> </p>
    <p align="left"><input type="submit" value="Send File" name="submit"></p>
    </form>
    </body>
    </html>
    You can download the oreilly files from :- (same code is also here)
    http://www.sybase.com/detail?id=1011664

    where I should write down the file path(The file in client pc....e.g. C:\Documents and Settings\abhishek.jain\Desktop\Daily Order Manual.pdf ) in code........I m getting stuck

  • Maximum size of upload file using Cross Domain Library

    Hi All 
    I need to know what is the maximum size of file that I can upload using Cross Domain Library from my Provider hosted app. I know that in msdn it is written that usign REST call we can upload upto 2GB but I have doubts if it is true with Cross domain library
    REST Calls. Please suggest.
     spExecutor.executeAsync(
                                   url: fileCollectionEndpoint,
                                   method: "POST",
                                   contentType: "application/json;odata=verbose",
                                   body: filedata,
                                   binaryStringRequestBody: true,
                                   headers: { "X-RequestDigest": $("#__REQUESTDIGEST").val(), "accept": "application/json;odata=verbose" ........
    And Can I pass ArrayBuffer directly or I need to pass only binary string ?
    Thanks in Advance 

    Hi,
    According to your post, my understanding is that you want to know the Maximum size of upload file using Cross Domain Library.
    Per my knowledge, you can upload files up to 2 GB with the REST API. 
    You can refer to:
    How to: Upload a file by using the REST API and jQuery
    In addition, you can pass ArrayBuffer directly. Please refer to:
    FileCollection methods
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • Upload File using MDS WCF API

    I have a field of File Type in my Entity. How can I upload file using WCF API?
    I tried to create a new Entity Member and added the following attribute in the member attributes collection
    Attribute att = new Attribute();
    att.Identifier = new Identifier();
    att.Identifier.Name = "Image";
    att.Value = bytes;
    In attribute value I tried to pass the bytes array of an image, also tried Encoding.ASCII.GetString(bytes); as attribute value, but none of them works.
    With byte array i get the following exception "Conversion failed when converting the nvarchar value 'System.Byte[]' to data type int." and in case of ASCII string i get "A database error has occurred. Contact your system administrator." error.
    There is lack of documentation and samples.
    Please let me know if someone tried it out.
    Thanks!

    You need to use the EntityMemberAttributesGet operation to retrieve the contents of a file attribute. EntityMembersGet is designed to retrieve a collection of many members and therefore it would not make sense to retrieve every file for every row retrieved.
    In contrast, EntityMemberAttributesGet is designed to work with a single member and specific attributes of that member, and it was designed to retrieve the file content.
    Val Lovicz
    http://www.profisee.com
    [email protected]
    As the original creators of Microsoft MDS, Profisee's Master Data Maestro provides a range of enterprise-grade functionality to ensure MDS project success.

  • For transaction code MD61, I want to upload data using BAPI

    Hi,
    for transaction code MD61, I want to upload data using BAPI.
    Which BAPi I ll call ?
    Can anyone suggest me how to do it with any simple example program ?

    Refer the thread for details about coding-
    BAPI_REQUIREMENTS_CREATE
    Reards,
    Amit

  • Upload files using browser

    how is posible upload files using a browser (IE5) to BD ?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JuanCarlos HorrachCampins (jchorrach@globalia:
    how is posible upload files using a browser (IE5) to BD ?<HR></BLOCKQUOTE>
    The Form enctype=multipart/formdata and input type=file parameters are needed along with method=post.
    You then need a servlet(or MS PostingAcceptor) on the server side to read/store it. The Post data is in multiple parts with the parms on separate lines..
    Here is sample HTML Form:
    <HTML>
    <BODY>
    <H2>Uplaod test </H2>
    <form enctype="multipart/form-data" action="/examples/servlet/MultipartForm"
    METHOD="POST"
    NAME="UploadFileForm"
    LANGUAGE="JavaScript"
    onSubmit="if (!validateForm(document.UploadFileForm))
    alert ('Please enter a fileName.');
    document.UploadFileForm.my_file.select();
    return false;
    }">
    <input type="text" name="TargetURL" value="/uploads">
    <input type="text" name="submitter" value="me">
    <FIELDSET> <legend> FileUpload</legend>
    <BR>
    <table>
    <tr>
    <td align="left">Fully qualified Filename to upload:</td>
    </tr>
    <tr>
    <td align="left"><input name="file" type="file" size="50"></td>
    </tr>
    <tr>
    <td align="left"><input type="Submit" value="Upload File"></td>
    </tr>
    <table>
    </FIELDSET>
    </form>
    <SCRIPT LANGUAGE="JavaScript">
    // Begin client side helper functions
    function validateForm(form)
    if (isEmpty(form.file)) return false;
    return true;
    function isEmpty(textcontrol)
    str = textcontrol.value
    for (i = 0; i < str.length; i++)
    chr = str.substring(i, i + 1);
    if (chr != ' ')
    return false;
    return true;
    </SCRIPT>
    </BODY>
    </HEAD>
    null

  • Uploading Files Using InputFile Component -- Sometimes not working

    Hello,
    This is the 2nd time I make a post about it!
    Because I have more than 1 application using upload, and everything is correct! But it doesn't work as it should!
    You can check the original post here: Uploading Files Using InputFile Component - Sometimes not working
    I need a solution please!
    The only thing we can conclude is that it could be a bug from oracle !!! (???) But I talked with other people and they say that it works fine for them.
    There is one important thing: when we put a form to "Uses Upload = true" it seems that the page doesn't work very normal. For exemple: if you use a table in a form that uses upload the table get's "crazy".
    Thanks,
    JP

    I have now access to METALINK!
    I can find some problems and patches about inputFile but not mine! I will check better later!
    I think the problem is caused because of my framework!

  • Attempting to upload files using the zend _file_transfer system from cs5 training from the source. [was: Question for David Powers]

    I am attempting to upload files using the zend _file_transfer system from cs5 training from the source.
    On trying to upload to a remote server I am having trouble with the destination setting (C:/upload_test) in the example, please could you point me in the right direction for the an example of this setting for a remote file transfer
    Also do I have to construct a connection file to activate a Ftp file transfer?
    David Woolston

    >I am on windows platform
    Who is your host? When you checked your host path in your host control panel, what did it say?
    >i have assumed (may be incorrectly) that the purpose of the exercise was to upload to a remote site (ie my website)
    That is correct.
    >Of course that upload might take place on a computer that does not have DW installed (an internet cafe for example)
    That's irrelevant. DW is just the tool you are using to build your site. The site runs on your hosting accounts servers. This includes the php scripts you are working with.
    >I have uploaded all files necessary for the operation, when i click upload it returns no such directory exits.
    Do you have a url we can check? What destination are you specifying in zend code?
    >This made me suspect that I would need to construct a ftp file transfer connection file to satisfied username, password , connection address etc
    The exercise you are dealing with is using http file transfer. This has nothing to do with FTP. You do not need FTP for this, other than using it to move your source code from your local client to your server.

  • Unable to see the uploaded file using gos object

    Hi Experts,
    I uploaded the file to server by using the below code. But I am unable to see the uploaded file. Please help me out hot to view the uploaded files (list the file name and view the content) (i want to upload the file by getting the url as input and by clicking the button)
    Code to upload the file.
    DATA: wa_zqtc_gos_request TYPE zqtc_gos_request.
      DATA: l_attachment        TYPE swo_typeid.
      DATA: lo_gos_service      TYPE REF TO cl_gos_document_service.
      obj-objkey  = req_num.
      obj-objtype = objtype.
      CREATE OBJECT lo_gos_service.
      CALL METHOD lo_gos_service->create_attachment
        EXPORTING
          is_object     = obj
        IMPORTING
          ep_attachment = l_attachment.
    I tyied with this to view the files but the attachement link is disabled. (i want to view the files by clicking the icon-GOS icon in tool bar)
      DATA: wa_zqtc_gos_request TYPE zqtc_gos_request.
      DATA: l_attachment        TYPE swo_typeid.
      DATA: lo_gos_service      TYPE REF TO cl_gos_document_service.
      obj-objtype = objtype.
      obj-objkey = req_num.
      CREATE OBJECT manager
        EXPORTING
          is_object = obj
        EXCEPTIONS
          OTHERS    = 1.
    Please help me out how to view the file and list.
    thanks & regards
    T.Tamodarane
    Edited by: T.Tamodarane on Oct 23, 2009 9:55 AM
    Edited by: T.Tamodarane on Oct 23, 2009 9:56 AM

    Hi,
    Please post ur thred below:
    PL/SQL
    Regards
    Meher Irk

  • Drag and drop not working when uploading file using safari

    why i cannot drag and drop any file when using safari , and what happens the file auotmatically open while i need to upload it only , extra for that , i cannot write  any remark or fill a space while using website related to my work.
    my work is to upload drawing files using dwf file to a website so the other parties can review and give me review , and then i reply to the remark at the same place and make meeting through the same site.
    please any body can give any way to correct my mac.
    latelly i installed win7 only to use it for that website , and iam now changing from mac to win whenever i want to work , this not acceptable to me because it is waste of time beside i like the mac and it working with other application but not for safari.

    why ?
    I'm sorry, but every OS is different.  You cannot expect all features of one to be in another.  Or alternatively, for similar features, be done it the exact same way. 
    It looks to me after a quick google search that winexplorer is basically the moral equivalent of the mac's finder to present the file system in different ways.  The OSX Finder also has alternative views of the file system, i.e., icons, list, columns.  Experiment with the list and column views and see if one of them are more to your liking.
    As for winexplorer on the mac.  I don't know if this simulates it or not but there is a program called Macintosh Explorer so check that out as well.
    And finally, in the end, as I said in my earlier post, no matter what, nothing on the mac is going to change what I believe you think you can do and drop a file on a browser window and expect it to upload.

  • Help!!! Upload Files using Applet.

    I've built an upload application using html tag <input type="file" ...>. Both client and server's programs have been finished for a long time. However, my boss want to use applet replace html tag(due to some reasons). I want to build an applet which allow user to select multiple files and then upload. But I don't want to modify the server side program. May anyone teach me on how to upload the files which generate the page which is the same as the HTTP request? Thanks a lot.

    No. You could sign the applet for granting the permission. Could anyone tell me how to generate the http request with contents and file inside?

  • Uploading file using OAS 4.0.8.1

    I am trying to upload files with an application using OAS 4.0.8.1 in
    linux (kernel 2.2.14). I am sure that all the environment are
    correct installed and my application wait forever.
    I'm using PL/SQL catrige.
    My database doesn't have any invalid objects.
    If somebody can help me, please.
    Thank you !
    null

    Some weeks ago I wanted to get to work it too. Without any success. It seems that file is going to server because of high traffic but I could not find any storage changes in the server even uploading large files. So I came to solution to use a PERL cgi script which stores file on the server filesystem and then passes filename and other attributes to a plsql procedure to save file attributes in tables. If you are interested in this script mail directly ([email protected]) or search for an example in http://cgi.resourceindex.com/

  • Uploading files using Zend Framework

    I am tyring to use the Zend Framework to upload files as outlined in the "Adobe Dreamweaver CS5 with PHP" book by David Powers.  I've been using the example code (more or less), and can get it to work perfectly with a local XAMPP installation of Apache and PHP.  Howver, I can't get it to work successfully with a hosted site, having tried both GoDaddy and Verio.
    The Zend Framework is correctly installed, include paths set correctly (I know this because other Zend FW operations, such as validation work fine).  In addition, if the directory I want to upload to isn't correctly specified I get errors on that.  But when I try to actually upload a file (again, with code that works on the XAMPP platform), I get nothing.  No errors, and no uploaded file.
    I have the script set up to send an email with a link to the uploaded file, and the name field is blank (but the email does get sent, again indicating that the ZF is working).  I'm concluding I have something incorrectly configured on the hosting plaforms, and am looking for suggestions as what to look at.  Thanks.
    BTW, checked the permissions on the upload directory, and it should be writeable...

    David,
    Thanks for the reply.  I neglected to mention that file upload do work on the server, it's just the Zend FW implementation that doesn't.  The Zend FW is basically what is in your book, and nothing happens when I try an upload, but I know that the code is talking to the FW (e.g., if I provide an invalid path, I get the appropraite PHP error).  If I don't use the FW it works.  So the following code correctly uploads a file on the hosting platform:
    if ($_POST['send']) {
    //validate the user input
    $val = new Zend_Validate_Alnum(TRUE);
    if (!$val->isValid($_POST['name'])) {
       $errors['name'] = 'Name is required';
    $val = new Zend_Validate_EmailAddress();
    if (!$val->isValid($_POST['email'])) {
       $errors['email'] = 'Email address is required';
    $val = new Zend_Validate_StringLength(10);
    if (!$val->isValid($_POST['message'])) {
       $errors['message'] = 'Required';
    if (!$errors) {
      foreach($_FILES as $temp_name => $file_array) {
       $file_name = str_replace(" ","_",$file_array["name"]);
       if (is_uploaded_file($file_array["tmp_name"])) {
        move_uploaded_file($file_array["tmp_name"], "$file_dir/".$file_name) or die ("Couldn't copy");
       $new_names[] = $file_name;
      //start building the mail string
      $msg = "Name:\n\t\t".$_POST["name"]."\n";
      $msg .= "E-Mail:\n\t\t".$_POST["email"]."\n";
      $msg .= "Message:\n\t\t".$_POST["message"]."\n";
      foreach ($new_names as $name) {
       if ($name != "") {
       $msg .=  "Link: xxx/uploads/$name"."\n\n";
    Using this code I wil email that contains links to the uploaded files, which I can then sucessfully download.  So it's the FW code that fails... and note that the Zend validation code above does work correctly; I get errors if invalid entries are made.
    Also, I note that my hosting providers only support PHP 5.2.14, whereas on my XAMPP installation I'm using 5.3  Could that be an issue?

Maybe you are looking for

  • Execute link is not working in Web report

    Friends, " Execute" link is dead in   web my report. And also the selection screen is blank for style sheets. Do you have any idea about the cause? Joe

  • 4KE5 not allocating Balance Sheet Accounts

    We created a new cycle for 2011, when we run 4KE5 we noticed that only expense accounts are being allocated correctly but balance sheets are not being allocated for a specific profit center. This was working in 2010. These accounts are non-recon acco

  • Ipod not wrking

    i had a 1 Generation ipod nano. I tried to make my own account on the computer and EVERYTHING deletd. once everything deleted the ipod stopped working. o went out and they gave me a new second generation ipod nano. it still wont work. When i went to

  • Qty still to be invoiced

    Hi. I want to know if there is any function or anyting else that provide informations about number of items from purchasing documents that still to be invoiced(MIRO) like in ME2L report; in other words differences between ordered quantity(purchase or

  • Is my hard disk telling me it gonna die?

    Hi all, I have all sorts of troubles since I install (after initialising it, with zero write) Snow Leopard on my MacBook 2.'GHZ, 2008-11. Now, a newly created window opens in the top middle of the screen (instead of some pixels from the left). I also