Hello and welcome to our community! Is this your first visit?
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
    Thanked 0 Times in 0 Posts

    File uploading problem in PHP with AJAX


    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. #2
    Regular Coder
    Join Date
    Sep 2007
    Grahamstown, South Africa
    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; Sep 17th, 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