Go Back   CodingForums.com > :: Server side development > PHP > Post a PHP snippet

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-10-2007, 10:40 AM   PM User | #1
mrbadboy
New Coder

 
Join Date: Jul 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
mrbadboy is an unknown quantity at this point
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 ?
mrbadboy is offline   Reply With Quote
Old 09-17-2007, 10:32 AM   PM User | #2
idalatob
Regular Coder

 
Join Date: Sep 2007
Location: Grahamstown, South Africa
Posts: 237
Thanks: 6
Thanked 17 Times in 17 Posts
idalatob is on a distinguished road
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 02:28 PM.. Reason: To add an important note.
idalatob is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:45 AM.


Advertisement
Log in to turn off these ads.