Results 1 to 20 of 20

Thread: Choosing a Picture & Send it To The Server

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Choosing a Picture & Send it To The Server

    Hi ,

    I have a Button & I want to choose a picture from my Computer & Then I send it to The Server

    Thanks !

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Choosing a Picture & Send it To The Server

    And the problem is...?

  3. #3
    Hyperactive Member dnanetwork's Avatar
    Join Date
    Oct 2007
    Location
    Mumbai
    Posts
    349

    Thumbs up Re: Choosing a Picture & Send it To The Server

    on server...create a database which stores picture's path...not the picture..

    then go to vb user picture box control and open dialog box control...

    using open dialog box you will receive an picture's path...and store on

    server's database...

    finally while displaying picture load the path from your server's database..

    it's very easy..and works...100%...

    if you'll have further problem...i'll mail you the code..

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Choosing a Picture & Send it To The Server

    Wow, hold on a second. The OP hasn't even asked a question, let alone mentioned any technical specifics.

    Most likely the question is how to upload via a web form, but let's wait for the OP to clarify that before making suggestions.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Choosing a Picture & Send it To The Server

    oK I have 2 button
    1/input type="file"
    2/input type="submit"

    in first one when i choose a file , i need to save the name of the file in the Table
    & The File in The Server

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Choosing a Picture & Send it To The Server

    See Handling File Uploads in the manual.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Choosing a Picture & Send it To The Server

    Hi Penagate ,
    Can You look at This Thread , i have made a function to do that

    http://www.vbforums.com/showthread.p...63#post3128963

    Thanks

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Choosing a Picture & Send it To The Server

    i am here now
    Last edited by killer7k; Feb 5th, 2008 at 10:54 AM.

  9. #9
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Choosing a Picture & Send it To The Server

    You should be using move_uploaded_file(). This will improve security by ensuring the file was indeed uploaded.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  10. #10
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Choosing a Picture & Send it To The Server

    Quote Originally Posted by visualAd
    You should be using move_uploaded_file(). This will improve security by ensuring the file was indeed uploaded.
    ... as you would have learnt had you read the article I linked to above.

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Choosing a Picture & Send it To The Server

    Strange when i make The formulaire in a page.html
    & To copie the file in a page.php It work Great
    but if there are both .php doesnt work
    show error : undefined index in NameofTheFile
    i dont know why & its the same code

  12. #12
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Choosing a Picture & Send it To The Server

    I don't understand what you are saying.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Choosing a Picture & Send it To The Server

    oK !
    I have a page which had 2 button Send & Submit
    Send : Choose a File From my Pc
    submit : Copy The File & Send it to The Server

    Now i am here
    There are 2 page :
    1: which has The Button & The Second which has The Event
    Last edited by killer7k; Feb 5th, 2008 at 10:54 AM.

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Choosing a Picture & Send it To The Server

    How I Can get The Value of $donnee['NUMEROMAMMOTEST'] of page 1
    to be Transfered on parameter to The Second page

  15. #15
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Choosing a Picture & Send it To The Server

    I still do not quite understand what you are doing here. I see no "Send" button. Only a submit button. I am not clear what you are doing and you screwed up the formatting on your previous post so it is also a nightmare trying to read it.

    I gather that you want to move the uploaded file to a directory and then save its name / path in a database. Why can this not be done on one page? Why do you need another page to do it?

    If you do want to do this then you should probably consider saving the name of the user in a session variable and retrieving that on the next page. Have a look at the PHP website.

    Etes-vous français? La version française peut-être de vous aider. Je ne parle pas bien français.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  16. #16

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Choosing a Picture & Send it To The Server

    Problem Solved !
    Last edited by killer7k; Feb 5th, 2008 at 10:53 AM.

  17. #17
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Choosing a Picture & Send it To The Server

    All you need to do is put the databse update code in the same script as the copy code.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  18. #18

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Choosing a Picture & Send it To The Server

    maybe but I was urgent so i do it with the second page
    Thanks anyway

  19. #19
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Choosing a Picture & Send it To The Server

    - and that wasn't the easier option.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  20. #20

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Choosing a Picture & Send it To The Server

    Yes but I had a short time to do it !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width