Input field data on database

suckerhead 01 Oct, 2007
I have form with upload file.
Everything goes smoothly.
but i dont have data input (file name on data table), so i know which file belongs to

for example:
- i upload file call picture1.jpg
- on upload directory the file exist
- but on my data table it's empty (null)

how to put the file name int the data table?

thanks.
Max_admin 01 Oct, 2007
Hi,

Lets try those steps:[list]
  • I will assume your upload field is called "fileup"
  • at the table creation screen, choose it very normally like any other field
  • After table creation, open your form in the backend for editing, go to the "auto generated" tab, Look for
    $_POST['fileup']
    replace it with :
    $_FILES['fileup']['name']
  • [/list]please let us know the results!!🙂

    Cheers

    Max
    Max, ChronoForms developer
    ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
    ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
    suckerhead 03 Oct, 2007
    still the same.

    1. the pic successfully upload to the upload directory.
    2. no data (filename) on the sql.

    i attached the form code and also the autogenerated code for your reviews..

    sorry, coz i dont have knowledge in php [file name=form_uploadfile.zip size=2131]http://www.chronoengine.com/components/com_fireboard/uploaded/files/form_uploadfile.zip[/file]
    danielmw1980 03 Oct, 2007
    I just wanted to mention that I tried this fix and it worked perfectly.

    -suckerhead; I glanced at your generated code and it appears correct with one minor issue.

    $_FILE['photo']['name']
    should actually be
    $_FILES['photo']['name'] –notice the S in FILES

    I believe that would resolve your issue. My apologies if I am incorrect.

    Thanks, this is an excellent component!

    Daniel
    suckerhead 04 Oct, 2007
    gooosshhh....

    sorry... i missed the 'S'

    all worked great...

    thanks a lot guys...
    Max_admin 04 Oct, 2007
    Thanks Daniel, Thanks Suckerhead🙂

    Max
    Max, ChronoForms developer
    ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
    ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
    orob 03 Jun, 2008
    hello ,
    i have the same issue.
    I have the attachement in tha mail, file is in upload folder, but i cannot see it in the backend, when I view the data. Field is empty.

    when I'm editing the autogenerated code, I cannot see this fileds you mentioned ( [POST] ) etc. so I cannot change it.

    I;m using joomla 1.5.2

    Any ideas?

    thanks !

    hello,
    i found the solution to display the name of the file http://www.chronoengine.com/component/option,com_fireboard/Itemid,37/func,view/id,8917/catid,5/limit,6/limitstart,6/ in the backend, one more thing i need. Is it possible to make it a link to the specified uploaded file ? the filename i see in the backend is missing the date chain which is added to every uploaded file for example: 20080603174616_kt_linie_lotnicze.txt and the filename is kt_linie_lotnicze.txt . is it possible to make it a link , or display the whole filename with this date?

    big thanks,
    cheers
    GreyHead 04 Jun, 2008
    Hi orob,

    I assume you are using Joomla 1.5.x - the Autogenerated code is different for that which is why you can't find the $_POST variables. This is an old thread, if you search the forums for FILES I'm fairly certain that you'll find newer posts with the information you need. Please post again if you don't.

    Bob
    orob 10 Jun, 2008
    hello ,
    i tried to find something about how to add link to database when files are uploaded.
    Please help me to find right topic
    Another issue is how to add multiple files to upload,
    it works fine with sanding email with two files , but i can't see them when looking in the backend ( i added
    '".$_FILES[$allowed_s2[0]]['name']."' ,
    in place where is the first file in auto generated code, but when i add the same in the other place where is the second file i get the same filename as the first one in backend)

    hope you udnerstood me ,.
    thank you very much for your help.

    Orob.
    GreyHead 10 Jun, 2008
    Hi orob,

    I need to go and look up how to store file paths in the databe, it's been a while since that was posted here.

    To get the second file info you probably need:
    '".$_FILES[$allowed_s2[1]]['name']."' ,
    Bpb
    orob 11 Jun, 2008
    hello,
    thanks .
    i tried that, but no luck,
    seems like it doesn;t work at all, even when I use only the code that you suggested for one uploaded file. (i'm using joomla 1.5.3)

    so what i want to achive is :

    1. upload 2 files and see them in backend (now I have only one)
    2. links in backend to specified files
    3. the whole name of the file in backend (with autogenerated date - now I have filename, without the date as prefix)

    i would appriciate if you could help me solve this problems.
    Maybe anyone has a solution for that.

    thanks
    Max_admin 11 Jun, 2008
    Hi Orob,

    Lets do it step by step, for the first file, add this code : $attachments[0], for the second, $attachments[1]

    tell me what can you see at the data view page by now!

    Cheers

    Max
    Max, ChronoForms developer
    ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
    ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
    orob 11 Jun, 2008
    Hi,
    thanks for your rapid response.

    I added:
    '".$_FILES[$allowed_s2[0]]['name'].$attachments[0]."' , 
    '".$_FILES[$allowed_s2[0]]['name'].$attachments[1]."' ,


    in place where was:
    '".JRequest::getVar('Zdjęcie','', 'post', 'string', '' )."' ,
    '".JRequest::getVar('CV','', 'post', 'string', '' )."' ,


    i'm not sure if i done it good,
    now i see still same two filenames in the backend
    GreyHead 11 Jun, 2008
    Hi orob,

    The variable name 'Zdjęcie' may be causing you problems - you see it shows up with the html entity in the code you posted. Please try a version without special characters like 'zdjecie'

    Bob
    orob 11 Jun, 2008
    hay,
    yes, i tried it also.
    im not sure if my code is ok , should it be like i wrote in my last post ?
    replacing this:
    '".JRequest::getVar('Zdjecie','', 'post', 'string', '' )."' , '".JRequest::getVar('CV','', 'post', 'string', '' )."' ,

    with that:
    '".$_FILES[$allowed_s2[0]]['name'].$attachments[0]."' , '".$_FILES[$allowed_s2[0]]['name'].$attachments[1]."' ,

    ?

    thanks
    This topic is locked and no more replies can be posted.

    VPS & Email Hosting 20% discount
    hostinger