Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    File uploading problem in PHP with AJAX

    Hi,

    Im trying to upload file using copy() in PHP. Here i couldn't get $_POST["cntrlName"]["tmp_name"] and $_POST["cntrlName"]["name"] if its in PHP with AJAX. But its working properly if i submit any page to PHP page. How to get "tmp_name" and "name" using PHP and AJAX ?

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts

    Umm could be difficult.

    Firstly you need to understand PHP. PHP only calculates the size/mime-type etc after the file is uploaded to a temp directory. You cannot force ajax to use a php function on a file that doesn't exist. My advice would be, copy the file via PHP without using AJAX, then use AJAX to get the information, and calculate whatever you like.

    Also It would help if you posted your code so we can see where its going wrong.
    Last edited by idalatob; 09-17-2007 at 03:28 PM. Reason: To add an important note.


  •  

    Posting Permissions

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