Return renamed uploaded file name

Hey,
I'm trying to upload a file from flash(selected via
filereference) via php, i rename(in php) the file before uploading
it. this isn't a problem and works great but then i need to return
the new filename to flash so i can save a link to it in my
database.
my biggest problem is that i use file.upload(phpScriptPath)
to upload the file. But if i use the echo command in php to return
newFilename i don't know how to capture this information in flash.
does anybody help me out?
thx on advance

You can't return the new filename using the FileReference
object so you need a workaround. From what you posted here I can't
put my finger on the right solution but to illustrate:
I needed a solution as part of a form where the user would
provide name, email and so on and could upload a c.v. Before the
file upload I used a LoadVars (and used the sendAndLoad() method)
object to post the data from the form and return the record_id from
the database. In the onLoad event of the LoadVars object I used the
FileReference object to handle the upload, calling an upload script
and added the record_id as a get variable. The record_id was then
used to save the new filename of the uploaded file to the database.
If this is not feasible in your situation, elaborate on the
topic by describing your scenario in more detail.

Similar Messages

  • Change upload file name with com.oreilly.servlet.MultipartRequest to handle the file upload

    1. when use com.oreilly.servlet.MultipartRequest to handle the file upload, can I change the upload file name .
    2. how com.oreilly.servlet.MultipartReques handle file upload? do it change to byte ?
    what  different?  if I use the following method?
       File uploadedFile = (File) mp.getFile("filename");
                   FileOutputStream fos = new FileOutputStream(filename);
                    byte[] uploadedFileBuf = new byte[(int) uploadedFile.length()];
                   fos.write(data);
                 fos.close();

    My questions are
    1) when use oreilly package to do file upload , it looks like i line of code is enough to store the upload file in the
    file direction.
    MultipartRequest multi =
            new MultipartRequest(request, dirName, 10*1024*1024); // 10MB
    why some example still use FileOutputStream?
    outs = new FileOutputStream(UPLOADDIR+fileName); 
        filePart.writeTo(outs); 
       outs.flush(); 
      outs.close();
    2) can I rename the file name when I use oreilly package?

  • How to get uploaded file name and path in BefExportToDat event script

    I would like to get hold of the uploaded file name and full path in the event script "BefExportToDat", as I need to extract values from particular fields. However I have not yet found a way to do this.
    - The input variable "strFile" returns the .Dat file path in the Outbox, to which it is about to export the data. This is no use to me.
    - The API variable RES.PstrFilename is returning nothing
    I am using RES.PstrFilename in the "BefFileImport" event script in a different FDM application and it works fine, however I need to find a way to get this to work in the "BefExportToDat" event script.
    Please let me know how this might be achieved.

    I am looking through the API calls in FDM Workbench, but cannot see the table (tPOVPartitions) you mentioned listed. Is this the correct name? And do I just use the function listed in the object browser to run the query?
    Furthermore (going back to my initial thoughts of using strFile), it appears that although the variable contains the .Dat filename and path, the actual file is non-existent when "BefExportToDat" is executed:
    Error:
    Error: Export failed.
    Detail: File not found.
    This would make sense, but it does make the variable "strFile" a little pointless since one cannot make use of the file in this particular event script. Do you please have any thoughts on this?

  • How can i change upload file name?

    hi
    I performed a upload Jsp page by OJSP file access in jdeveloper,and it can upload file!
    but i want to change uplaod file name!
    How can i do?
    Any help will be appreciated!
    Thanks
    Jiawei Zhao

    My questions are
    1) when use oreilly package to do file upload , it looks like i line of code is enough to store the upload file in the
    file direction.
    MultipartRequest multi =
            new MultipartRequest(request, dirName, 10*1024*1024); // 10MB
    why some example still use FileOutputStream?
    outs = new FileOutputStream(UPLOADDIR+fileName); 
        filePart.writeTo(outs); 
       outs.flush(); 
      outs.close();
    2) can I rename the file name when I use oreilly package?

  • Can We rename BAD File name in SQL Loader

    Hi All,
    Can we rename BAD File name in SQL loader?
    If yes, how?
    Thanks in Advance,
    S

    Hi,
    You can rename the bad file before running SQL*Loader, or specify the name of the bad file using the BADFILE clause followed by a filename. If you do not specify a name for the bad file, the name defaults to the name of the datafile with an extension or file type of .bad
    Specifying the Bad File
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28319/ldr_control_file.htm#i1005085
    Regards,
    Hussein

  • Rename the file names

    Hello OTN Help,
    I need to modify my old existing question.
    Reason is as follow:
    One of my question I entered some thing which is not appropriate for my company policy and they want from me to rename the file names.
    Please advice me what should I do?
    thanks

    Are you talking about changing the question that you have entered on OTN? If so, I guess you will need to contact Oracle support and have them to request OTN admin to do so ... good luck.
    -Frances

  • How to keep original Uploaded File Name in SharePoint Document Library?

    HI,
    I have document library. After Uploaded the file in document library. I want to keep the file name in some other filed.
    Why because in future i may change the file name in document library so in order to know the original name of the file.
    I want to do without any workflow. Is there any other default column like that?
    How could i achieve it?
    Thanks & Regards
    Poomani Sankaran

    Hello,
    Here is list of operations for file element, and you can save it in library column:
    http://social.technet.microsoft.com/wiki/contents/articles/22156.sharepoint-2010-a-complete-list-of-spfile-operations-using-ecma-script.aspx
    http://sprider.org/2011/12/13/sharepoint-ecmascript-to-adddeleteupdateget-list-items/
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Upload file name on BT Cloud

    I'm finding that one or two of my files being automatically backed up are taking a great deal of time.
    Is there any way to find out the file names as files are being uploaded.
    All Cloud says is "uploading 2 or 13 files" etc.
    Surely, the App should be able to post the filename as it is uploading it ?
    Thanks...............EBT

    Hi,
        Can you try to reset the attribute which is bound to file name UI Element?.
    Kind Regards,
    S.Saravanan.

  • Rename master "file name"

    Is there a way to rename the master file name?
    Currently, the only way to do this is:
    1. Import the files into a folder first and rename the files. Then
    2. Import the rename files into Aperture.
    or
    3. Delete files from aperture but do not empty
    4. Recover these files from the trash. Rename them.
    5. Import them back into Aperture.
    This is a pain in the * process.
    Any other ideas?

    Is there a way to rename the master file name?
    Currently, the only way to do this is:
    1. Import the files into a folder first and rename
    the files. Then
    2. Import the rename files into Aperture.
    or
    3. Delete files from aperture but do not empty
    4. Recover these files from the trash. Rename them.
    5. Import them back into Aperture.
    This is a pain in the * process.
    Any other ideas?
    One of my favorite OS X tools is "A Better Finder Rename" - (http://www.publicspace.net/ABetterFinderRename/index.html). I used to have my own Applescript to rename, but this ran circles around mine.
    Before Aperture, I'd import to a folder, do a simple culling (via Bridge), then rename everything to my conventions (D05_01322.DCR, etc).
    If you want to import directly from a card reader WITH renamed images, you can try this utility as another method. Yesterday I used it to do a simple experiment to allow a Master file to be renamed BEFORE importing into Aperture:
    1. Be sure to open your preferences and set the "When camera is connected, open:" to "No application".
    2. Mount your card reader with card you want imported.
    3. Select the files you want renamed, then open "A Better Finder Rename" and select to Change "only the file name".
    4. Inside Aperture, import the renamed Master images with your personalized names.

  • Renaming original file name.

    Hi!
    Can I rename original content file name (contains in dOriginalName) before check in? Idoc script? Something else?
    screenshot: http://imageshack.us/photo/my-images/39/3006.png
    Thanks!
    Edited by: 869483 on 30.06.2011 7:55

    Shamil,
    based on your scenario, I do not think Profiles are a good way to go. Why? Because the value of your field is dependent on values from other metadata fields which might be editable.
    I can imagine you will be able to get there somehow (with the use of idocscript) the notation yyyyMMdd - this is a value you will have on the page load (unless checkin dialog would be opened over midnight).
    I can also imagine that document type is somehow bound to your profile.
    Nevertheless, you will never have the file extension - this is totally user-dependent value. Even though you can define some dependencies between metadata fields (on front-end), I would not know how to change a value based on primaryFile extension, to be honest.
    On the other hand, if you do the same in a Java filter (when you are sure that the value will no longer change), it is an easy task. For filters, take a look at DynamicPrefix from HowTo components (see this page for 10g http://www.oracle.com/technetwork/middleware/content-management/index-092832.html or this page http://bexhuff.com/2011/03/howto-component-samples-for-oracle-ucm-11g for 11g).
    Another comment: do you realize that if you store two documents of the same extension in one calendar day, that your name is not unique? (just in case you want to use it somehow for the identification)
    I have also a question to you and Srinath: can you describe how dOriginalName can be added (to be filled in) to a rule/profile? I don't see it in available fields when I define a rule...

  • Renaming Uploaded File

    Hi, I am trying to figure out a way to automatically rename a
    file as it is uploaded by a user of my website based on a
    recordset. Does anyone have any idea on how to do this. The file
    will not be just one type but both images (JPG) and video (AVI).
    Thanks,
    Craig

    How easy this will be depends upon the server langauge that
    you are using.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "h2ojefe" <[email protected]> wrote in
    message
    news:e7b1aq$pum$[email protected]..
    > Hi, I am trying to figure out a way to automatically
    rename a file as it
    > is
    > uploaded by a user of my website based on a recordset.
    Does anyone have
    > any
    > idea on how to do this. The file will not be just one
    type but both images
    > (JPG) and video (AVI).
    >
    > Thanks,
    > Craig
    >

  • An App to rename photo file names to date taken?

    Does anyone know of an app that automatically names the photo's filename to the date the photo was taken?
    Thanks

    Photos on an iPad do not have meaningful file names.   If you synced Photos through iTunes their file names are turned into number sequences (ie img_95040.jpg).  There is nothing to search for that would be of any relevance, hence no to application really do this that I know of.

  • Renaming attachment file name in receiver mail adapter

    Experts,
    I have a file to mail scenario where an xml file is picked up and transformed into the target format in XI which has to be sent as an attachement in an email on the receiver side.
    I am getting the mail with the attachement. But I would like to rename the attachment as the name of the picked up file.
    I am using Adapter specific message attributes on both sides but the attachment is named as untitled.xml.
    Please advise. Can this be achieved by using the swap bean or the message transform bean?
    Regards,
    Shobhit

    Hi Shobhit,
    The module tab of your mail adapter will look like this.
    Processing Sequence
    Module Name                                                            Type                                      Module Key
    localejbs/AF_Modules/MessageTransformBean   rename LocalEnterpriseBean     
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean  mail     Local EnterpriseBean     
    Module Configuration
       Module Key               Parameter Name             Parameter Value
          rename      Transform.ContentDescription                      File
          rename  Transform.ContentDescription  attachement;filename="yourfilename.ext"                                                          
          rename            Transform.ContentType                 application/text;name="yourfilename.ext"
    Thanks
    Amitanshu

  • Rename the file name of a Vault (not the Vault name)

    I have a Maxtor Sahred Storage Plus and I am now planning to use it for backing up Aperture. Yes, I now that Aperture is not made for back up on a network, but it should be possible according to this thread: http://discussions.apple.com/thread.jspa?messageID=2245775&#2245775
    My problem is that the filename of the vault is either to long or contains characters which the Maxtor do not accept so I can not copy the vault from Finder as suggested in the above thread. My question is if someone now if it is OK to rename the filename of the Vault?
    Macbook Pro   Mac OS X (10.4.7)  
    iBook   Mac OS X (10.4.6)  

    Hi,
    you can't.
    Except you save the file under a different name before you send it.

  • File Upload - File Name in Hebrew problem

    Hi all,
    I am using file upload with IWDResource in NW04s and while loading files with hebrew encoding I am getting gibrish when using
    getResourceName()
    method.
    I also tried working with data and fileName properties - both giving null.
    Any ideas?
    Thanks,
    Aviad

    Hi Levy,
    Use this code in action button for upload a file
    Here up is a context attribute of type "com.sap.ide.webdynpro.uielementdefinitions.Resource"
    It is to be bind with upload UI element property called "resource"
    InputStream text = null;
    int temp = 0;
    try
    File file = new File(wdContext.currentContextElement().getUp().getResourceName());
    FileOutputStream op = new FileOutputStream(file);
    if(wdContext.currentContextElement().getUp()!=null)
    text = wdContext.currentContextElement().getUp().read(false);
    while((temp=text.read())!=-1)
    op.write(temp);
    op.flush();
    op.close();
    String path = file.getAbsolutePath();
    wdComponentAPI.getMessageManager().reportSuccess(path);
    catch(Exception e)
    e.printStackTrace();

Maybe you are looking for

  • REP-271468673 Saving report to pdf

    Report upgraded from Reports 6i to Developer 10g fails only when output to a pdf file with error REP-271468673. Report returns to screen without issue. Report output is 6k+ pages and 3.5k images. Can anyone offer assistance?

  • How to import from old address book?

    Hi all, I've searched the net about my problem but with no result. I have an old mac (a G3 iMac running 10.3.9) with a lot of contacts on its Address Book, and I do mean a lot. The computer is completely dead, but I have a copy of the contents of its

  • How to save to disk ?

    I've extracted an image from a larger draw > cropFilter = new CropImageFilter(630,230,150,150); croppedImage = createImage( newFilteredImageSource(image.getSource(),cropFilter)); And built a buffer >>>> buffer = new BufferedImage (150,150,BufferedIma

  • Based in Switzerland and trying to decide on SAP training

    I am trying to choose the best SAP course to take. My objective is to empower myself in the Job market. I reside in Switzerland. I have a Bachelor degree in computer Science, but I deviated from I.T because I started enjoying working on business proj

  • PLEASE HELP-Is there a way to spell check footnotes in indesign cs2 separately

    Is there a way to spell check footnotes in indesign or in incopy cs2 separately?