Php - get name from 'file field' and pass to database?

Is it possible to extract the 'image' name from the 'file' field and insert it into a database using php?
<input type="file" name="ImageName" id="ImageName">
I can't have:
$ImageName = trim($_FILE['ImageName']);
So hows this handled?
Cheers
Os

Murray *ACP* wrote:
Should be pretty strightforward, Os.  You know where to ask the questions!
Yeah.. but I keep coming up against brick walls
I'm trying to manipulate David Powers PHP Solutions chapter 6 - Uploading Files.
He's got some sort of complicated function going on which makes sure no two images which are uploaded to a folder have the same name. i.e., london.jpg becomes london_1.jpg. (the php even inserts underscores if there are gaps in the image name)
If I just use $ImageName = $_FILES["ImageName"]["name"]; potentially I could end up with dozens of images with the same name in the database, which is NOT desirable.
Of course I could simplyfy everything and use two forms - 1 for uploading the images to the upload folder and then one for inserting the images details into the database BUT that has the drawback of the client needing to type in the name of the image identically to match the name which has been generated in the upload folder and that aint gonna happen in a million years

Similar Messages

  • How to load images from file system and save in database

    Hello Fellows!
    I have a problem and try to explain:
    Plateform:
    Operating System: Windows 98, Form 6i and Oracle 8
    Table in the database
    Table:Emp_pic with columns i.e. (empno and pic type long raw)
    In forms, I have a data block which contain the columns of the emp_pic table and a control block which have a push button contains the trigger as follow, also attach PL/SQL library i.e. D2kWUTIL.PLL
    When-Button-Pressed (Trigger)
    Declare
    temp varchar2(400);
    Begin
    temp := win_api_dialog.open_file('Open File','d:\pic','*.tif',true,win_api.ofn_flag_default,false);
    read_image_file(temp,'tif','emp_pic.pic');
    end;
    The problem when I pressed the button it does not display open dialog box what is the wrong with the code or else.
    Thanks in advance
    (BASIT)

    What do you mean "it did not work"? You need to post more information, such as what errors you got.
    My guess is that it did work, but it ran on the middle tier, which is where Forms is running. Commands like that need more work to execute on the client.
    Go to the Forms area on OTN and download the Oracle9i Forms Samples. They have demos and source code to move files from the client to the server.
    Coming soon will be a utility called WebUtil which will make this even easier.
    Regards,
    Robin Zimmermann
    Forms Product Management

  • How can i get the name of a symbol and pass to a variable?

    Hello! Is posible to get the name of a symbol and pass to a variable??
    Thanks
    Sonia

    Ok. Bravo
    Please mark this as 'Answered' - it will help others on the forum -

  • Get data from file in server to client and vice versa

    after greeting
    i really didn't know how to use socket and serversocket to get data from file in the server and display it to client.
    also read file from client and save it to server.
    really i didn't know how to do it.
    really i want the reply as soon as possible

    You REALLY need to work through the Java networking tutorials:
    http://java.sun.com/docs/books/tutorial/networking/index.html

  • How to open a page from a Form and pass parameters to the form on that page

    I found a similar example on this forum, but it did not work for me:
    declare
    l_names owa.vc_arr;
    l_values owa.vc_arr;
    i number;
    begin
    PORTAL.wwpro_api_parameters.retrieve(l_names, l_values);
    FOR i in 1..l_names.count
    LOOP
    htp.p(l_names(i) || ' ' || l_values(i));
    END LOOP;
    end;
    By using this method i get the parameters for the Form, like the session ID, but not the parameters for the Page that the form is displayed in.
    Another method I tried:
    To open a Form from a Form and pass parameters works fine like this:
    --In the After processing page PL/SQL event.
    declare
    v_id number;
    blk varchar2(10):='DEFAULT';
    Begin
    v_id:=p_session.get_value_as_number (p_block_name=&gt;blk,p_attribute_name=&gt;'A_ID');
    if v_id &gt; 0 then
    htp.formOpen('PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=2649500412&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=ID&p_arg_values='||to_char(v_id),'post');
    htp.formSubmit(NULL,'Upload Files');
    htp.formClose;
    end if;
    End;
    But I want to open a Page containing the Form instead of just opening the Form. Is this possible to open a Page and pass paramters to the page, and then let the form inside the Page access the passed paramters. The reason for this is that a Form cannot be based on a page template, or can it? When opening the form i want to keep the left menu, which I can if it is a page based on my template with the left menu.
    Best regards
    Halvor

    Hi,
    You can do this by calling the url of the page with the form. You can then use p_arg_names and p_arg_values to pass parameters. In the called form you can get the value from p_arg_names and p_arg_values and assign it to the form field.
    You can call this code in the success procedure of the calling form.
    declare
    v_id number;
    blk varchar2(10):='DEFAULT';
    v_url varchar2(2000);
    Begin
    v_id:=p_session.get_value_as_number (p_block_name=>blk,p_attribute_name=>'A_ID');
    v_url := <page_url>;
    if v_id > 0 then
    call(v_url||'&p_arg_names=id&p_arg_values='||v_id);
    end if;
    End;
    In the called form in "Before displaying form" plsql section write this code.
    for i in 1..p_arg_names.count loop
    if p_arg_names(i) = 'id' then
    p_session.set_value(
    p_block_name => blk,
    p_attribute_name => 'A_ID',
    p_value => p_arg_values(i)
    end if;
    end loop;
    This code picks up the value from p_arg_values and assigns it to the form field.
    Hope that helps.
    Thanks,
    Sharmila

  • How do spammers get names from my Contacts?

    Can someone explain how spammers get names from your contacts?  The typical e-mail says it is from a person that is in my contact list but of course the actual e-mail address is not from that person.  It says that it is addressed to my name and the e-mail will say something like, "Dan, you need to try this!" and then has a link which of course I never click on.  So how do they know both the name of my friend and me?  Is that something they got from my friend's computer, from mine or from other traffic they have intercepted between us?  I'll copy the headers below, removing the name of my friend and my comcast, if that helps.  I note that there is a spam rating of "00000".  Mail spam filters don't seem to help this kind of junk.  Any other way to catch it?
    Name from my contacts <bluedreams_182000@****>
    To: Dan <my email at comcast>
    Reply-To: Name from my contacts <rlhwygaoumbg@****>
    Return-Path: bluedreams_182000@****
    Received: from imta01.emeryville.ca.mail.comcast.net (LHLO imta01.emeryville.ca.mail.comcast.net) (76.96.30.13) by sz0012.ev.mail.comcast.net with LMTP; Wed, 27 Feb 2013 14:39:31 +0000 (UTC)
    Received: from nm25-vm2.bullet.mail.ne1.yahoo.com ([98.138.91.213]) by imta01.emeryville.ca.mail.comcast.net with comcast id 5Sf51l00Y4cByPW01SfVQG; Wed, 27 Feb 2013 14:39:30 +0000
    Received: from [98.138.90.53] by nm25.bullet.mail.ne1.yahoo.com with NNFMP; 27 Feb 2013 14:39:09 -0000
    Received: from [98.138.226.128] by tm6.bullet.mail.ne1.yahoo.com with NNFMP; 27 Feb 2013 14:39:09 -0000
    Received: from [127.0.0.1] by smtp215.mail.ne1.yahoo.com with NNFMP; 27 Feb 2013 14:39:09 -0000
    Received: from localhost ([email protected] with login) by smtp215.mail.ne1.yahoo.com with SMTP; 27 Feb 2013 06:39:09 -0800 PST
    X-Caa-Spam: 00000
    X-Authority-Analysis: v=2.1 cv=Y8ZABXuN c=1 sm=1 tr=0 a=yFh+eeAJilq5jagfoJ6Fqg==:117 a=CjxXgO3LAAAA:8 a=C_IRinGWAAAA:8 a=f8_S3n9t2uQA:10 a=T2eDSQWuq6oA:10 a=oJL9TIRMo0YA:10 a=wPDyFdB5xvgA:10 a=YbZ8FP2_cKMA:10 a=qHrs9QlyAAAA:8 a=SOyKGQC6J-v4blZxIL4A:9
    Authentication-Results: imta01.emeryville.ca.mail.comcast.net; dkim=pass header.d=yahoo.com header.b=My3CIG6B
    Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1361975949; bh=SJ8H66WD9dGkowyk01012kCKbuWqBy+0rI9R1qHqC2I=; h=X-Yahoo-Newman-Id:Message-ID:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP :Received:Subject:To:Date:Reply-To:From; b=My3CIG6BbP+C/REBNH0Pl1rvm3yRuYtg8FtSI9ICCCs5C3CwVik60zu9fmZ2TDVhIX45i0GSorNyM VeTh+4xG3CW4ugdA6f1/d84sSiaUH069pESMpBzR4PanZjFJt+OjjqTIHZW1xUcMUbk6aRTDV9IjpJoV ob5uvvmpjqpAq8=
    X-Yahoo-Newman-Id: [email protected].****
    Message-Id: <[email protected].****>
    X-Yahoo-Newman-Property: ymail-3
    X-Ymail-Osg: mI56qykVM1m4NTZzp53SpESUznrR9CMCxL1wR5kVhIPDSm_ kgx2B8h0MD84jBKTlb1pB40CAsrAcfoA1ObW.pSgRW1HNt962Rte8ky0A.Yq kExYbORoTN8V3EDFYI31vSePX_zypIbH.LPF0Dknu2dL9HE2ORUPTQ9QqNxr MYgfV7xcMNkoTXbptAnMOyFotVy2WGQs8SGccKGnfGQngm7lXZirQ_4MxAVV R4d9JZcQJaBCjksPq7MIUchCs8L3HKkwkd2PT3i8X3ceu08kjN_gUx_NlNtN 0fL1_i5PcYCl0Rc3tuew.vndrrt2b7fevo1E3Xqd6imPee4FFHll_yWV2c1v yGEMAYsx7fB9XbomsYZtJK9k6JguE.VIGjx1xQpiqszDEPLqILJ6uChhhCyA 9pCaw0u_Qbmdie7VdZRwZT7P.6D8GyhUb5AZ9EbXRNIwX2Hgq8DkkQa9QbI6 tCtZFp40KLE45lJCgg1K5frkPDFS.hSRljN1G7HnkkIeDZh63TOQ2DjLO_3B Q80PjDp5FFz9.1LZI3AsPsdeBpz3B_VIHzz_suN1aFQ--
    X-Yahoo-Smtp: l_K7TJWswBDTfM_9zVF_23qtYt8VWAIMESQlX2QM
    <Emails Edited By Host>

    Someone has gained access to the Contact attached to your email account, probaby online (they don't need access to your computer) It is now too late to change that but change your password.
    Both Comcast and Yahoo are about as secure as a wet paper bag.

  • Call tcode from alv report and passing  group of values

    hi all .
    i want to call tcode from alv report and passing an internal table or group of values to a selection option of that t code ? how
    ex. passing group of GL to fbl3n and display the detials of all .
    thank you

    Dear,
    You have done a small mistake
    --> rspar_line-option = 'EQ'.
         rspar_line-HIGH = PDATE-HIGH.
    u r passing "high" value and in "option u r passing "EQ" so how it will work!!!
    So if u r passing only 1 date or more dates like 01.01.2010 , 15.02.2010 , 10.03.2010 then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'EQ'.
    rspar_line-LOW = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    or if u r passing low & high date means in range like 01.01.2010 to 30.01.2010, then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'BT''.
    rspar_line-LOW = PDATE-LOW.
    rspar_line-HIGH = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    try above code , hope it helps...
    i think u cannot use "call transaction using bdcdata" in ur case bcoz as u said in ur 1st post u want to display the details of all but still if u want to use then u should pass all parameters in  loop.
    PROGRAM
    DYNPRO
    DYNBEGIN
    FNAM
    FVAL
    ex:-
    LOOP AT GT_TEMP INTO GS_TEMP.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = 'SAPXXXX'.
    bdcdata_DYNPRO = '1000'.
    bdcdata_DYNBEGIN = 'X'.
    bdcdata_wa-fnam = '''.
    bdcdata_wa-fval = ''.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'SD_SAKNR'.
    bdcdata_wa-fval = GS_TEMP-GLACCOUNT.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = 'XXX'.
    APPEND bdcdata_wa TO bdcdata_tab.
    ENDLOOP.
    try above code if u r using call transaction...
    Edited by: mihir6666 on Jul 9, 2011 3:10 PM
    Edited by: mihir6666 on Jul 9, 2011 3:11 PM
    Edited by: mihir6666 on Jul 9, 2011 3:13 PM

  • How long does it take to get approval from iTunes Connect and how do I find out if they are working on it?

    How long does it take to get approval from iTunes Connect and how do I find out if they are even working on it? I'm not really sure if my application was even delivered - from the links in IBA. Any suggestions how one might push the right buttons at Apple?
    Also went around in a big circle trying to get beyond the confusion of not having the right Apple ID when I've had it a long time. Confusion abounds and learning this forum also takes a new degree of patience. Humbling to say the least :-)
    Anyone been there done that?

    [email protected]
    [email protected]
    …support phone number call +1 (877) 206-2092.
    Global Phone Support
    We have expanded English-language publisher phone support. To make contacting the iBookstore support even easier, new local phone numbers are now available for Australia, France, Germany, Italy, Netherlands, Spain, and the U.K. Support is available Monday to Friday, from 7 a.m. to 5 p.m. (PT).
    Country
    Phone Number
    Australia
    1300 307 504
    Note that this is a low tariff number.
    France
    0805 540 117
    Germany
    0800 664 5307
    Italy
    800 915 902
    Netherlands
    0800 0201 578
    Spain
    900 812 687
    U.K.
    0800 975 0615
    U.S.
    +1 (877) 206-2092
    Toll-free from U.S. and Canada.

  • TS5185 Hi After I have report a junk message I coudl not get Imessge from other iphone. and could not send any message in blue color but green which need to pay for.

    Hi After I have report a junk message to 7726, I coudl not get Imessge from other iphones. and could not send any message in blue color but green which need to pay for. Does Apple blocked my imessage ? I have checked the setting. imessage is on.
    Thanks,
    J

    Make sure that your date and time settings and time zone are accurate (Settings - General - Date and Time). Reset your phone to 'Set Automatically' and then try signing in again - this worked for me.  My date/time settings were not automatic (candy crush cheats!!).

  • Search result to get data from bing search and display it in sharepoint page.

    I have configured result source which gets data from bing site,i have given following url as source url
    http://www.bing.com/search?q={?searchterms}&format=rss&Market=en-Us
    but it returns only 8 results from RSS. i want to get all results of search and display it in my SharePoint search results page. 
    any pointers will be helpful. 

    Hi,
    According to your post, my understanding is that you wanted to search result to get data from bing search and displayed it in sharepoint page.
    To display more items, you can modify the item number when you add
    New Query Rule.
    To get all results, I recommend to use the “Show More”
    link in the result page.
    You can enter the URL when you add New Query Rule:
    "More" link goes to the following URL: http://www.bing.com/search?q={searchterms}
    Here is a great blog for your reference:
    http://sharepoint-community.net/profiles/blogs/integrate-bing-with-sharepoint-online-2013-search
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • B2B 11g: Getting File Name in inbound integration and passing it to SOA

    Hi,
    I am Reading a EDI x12 file in inbound B2B .I am checking the 'preserve File Name' check Box at Listening channel properties.....Then Integrating B2B to soa using AQ Adapter.But I couldn't find any property where I can pass the file name which I read through B2b to Composite. I need the file name because I am inserting all the records in Database and client wants to see which record in DB has been inserted from which file.
    Any pointers would be helpful.

    Hello,
    Try to use the b2b.fileName property. Although it probably is not shown on the list you should be able to access it.
    Also, please check the patch 18021286 which has many improvements and allows for two cases that can be useful for you:
    - Get information on back-end about which channel and agreement was used to deliver
    - Using callout Ret values which allow for specific properties to be set on callouts and passed all the way until the back-end application.
    Hope this helps.
    Best Regards
    Tiago Teixeira

  • How to execute an SSIS package on a scheduled basis from remote server and pass in input files

    I have an application server and a db server.  My db server has all things SQL Server stored on it (DBMS, SSRS, SSIS, etc.)  I have several nightly batch process SSIS packages (dtsx files currently) that will pickup an input file and import them
    into the database.  I would like to execute all batch processes from my application server as I have quite a few other ones as well that do other stuff outside of SQL Server via powershell.  My question is how to do this?  Is there away to execute
    them remotely via DTexec.exe, should I set them up as Agent jobs and somehow pass in the file names\location (how?), create and SSIS catalog, etc.?  
    I need to easily be able to see if the packages execute successfully or not and if not capture the detailed information of why they failed from the remote server so I can use that to drive my process flow logic in the batch processes.

    Hi Jason,
    According to your description, you want to execute a package on a schedule and receive notification when package ends with error in the job.
    After testing the issue in my environment, we can directly add the package in a step of a job, then add a schedule and set the Alert and Notification property in the job to achieve your requirement. For more details, please see:
    Create a Database Mail in the SSMS.
    Right-click the SQL Server Agent services to Enable mail profile, then select the appropriate Mail profile.
    Under the Operators folder, create an operator with the correct E-mail name.
    Right-click the Jobs folder to add a new job.
    In the Steps pane, New a step with SQL Server Integration Services Package Type to run the package.
    In the Schedules pane, New a schedule for the job.
    In the Alerts pane, New an alert with SQL Server event alert, then enable Notify operators option with an operator in the Response pane.
    In the Notifications pane, enable Email option with same operator and When the job fails selection.
    Then when the package fails, the job would be failed and we can receive the error message in the mailbox.
    Besides, please make sure the account that execute the job has correct permissions for the file, for the folder that contains the file, and for the database.
    References:
    Configure Database Mail – Send Email From SQL Database
    How to setup SQL Server alerts and email operator notifications
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • How to get file name from file adapter (Read Operation)

    Hi All,
    I am reading files from local location, in jca file i gave filename property =*.* ( which reads all files), and now I want to read the incoming file name inside bpel and I want to copy the file name to some variable. Is this possible?

    Yes, its possible.
    In your receive activity,set below property in its properties tab:
    <bpelx:property name="jca.file.FileName" variable="FileName"/>
    Before that make sure to create a variable "FileName" of string type.
    Whatever file your file adapter will read,its name will be stored in this variable.
    Hope this helps.
    Regards,
    Karan
    http://learn-oraclesoa.blogspot.com/

  • Get name from Outlook Global Address List and other info

    Hi, I hope somebody can help me. I'm new in Acrobat scripting so I need some more Help.
    I have a link that executes a script that will send an e-mail message.
    This is my script:
    app.mailMsg(true,"[email protected]","[email protected]","","This is the subject","This is the body of the mail.");
    I noticed that when executing this script, Acrobat opened the Outlook Global Address List to verify the e-mail accounts; which is great.
    Now, I'd like to know if there is a command that does this:
    1. (before opening Outlook new message window) Open a window asking for the recipient e-mail address.. with the possibility to get it from the Outlook Global Address Book
    2. Open a second window asking the same as above but putting the e-mail address in the "CC" field.
    2. Finally, the New Message window appears with the "to", "cc", "subject" and "body" fields filled.
    I'd really appreciate your help.
    Also.... is there any other command to get date and hour in a variable?
    Thanks :)

    Hey Cristian,
    I'm interested in your link script. How do you use it? In what program are you and where do you put the actual script?
    Thanks,

  • How to get description from the field name

    Hello fellow SAP Fanatics,
    I am trying to find an easy way to get the description of a field if I know the technical name. I know I can view them in tables but is there one place where I can just look up the field and get the description?
    Thanks.

    Hello
    For all the tables, descriptions and fields you can refer to these tables:
    DD02L : ALL SAP TABLE NAMES
    DD02T : DESCRIPTION OF TABLE NAMES
    DD03L : FIELDS IN A TABLE.
    Moreover you can always goto the menu on the selection screen of the table and goto Settings > User Parameters > Key word > Field name / label
    Hope this helps

Maybe you are looking for

  • Calling a web service in an ABAP code

    Hello Experts,       Is it possible to consume a web service in an ABAP code? Note: I am using SAP R/3 4.7. Thanks! Jeffrey

  • Hierarchy loading Error in Production system

    Hi All, I am loading Hierarchy file, the file is there in application server(AL11), in external tab i gave same path. but when i try to load it is showing below Error message. Invalid entry, hierarchy 0XMK4PVWO05BM4GP5KVEFQ9L4 does not exist. Diagnos

  • Instead of sleeping, MacMini goes into a coma

    This doesn't happen every time, but it does happen; I'd say 50% of the time . I either put the Mac Mini to sleep myself, or leave it to go to sleep by itself when it reaches the set time limit. When I wake it, which I usually do by just hitting a key

  • 5800 V40 Firmware: Calendar Problem

    Yesterday I updated my firmware to version v40  This moring I had a reminder in my Calendar of my nokia 5800, when a reminder is show the screen it is different then before, Only one problem the touchscreen won't react, when i push stop nothing happe

  • Production Order cancellation for wrong confirmation

    Hello Guru, We have wrong confirmation on order 100000152. When user confirms one activity with two different units of measure (in this case its MIN and KG) SAP doesn't allow to cancel the wrong confirmation we encounter error when trying to cancel t