473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

File upload in ajax with PHP

hi,
im trying to upload a file using ajax and php. im not able to get the $FILES[fileName][tmp_name] and
$FILES[fileName][name].

But when i try it out in the traditional format its works good. but when i try it out in ajax im not able to get these values.

I use POST method and the requestHeader's content type is set as multipart/form-data.

Looking forward .....

Thanks in advance for the reply
Jul 10 '07 #1
6 2751
do u using any other Content-type except multipart/form-data?
Jul 10 '07 #2
do u using any other Content-type except multipart/form-data?
Yes i have used all others but in fail the thing is im not able to get the tmp_name value in the php file. but using the other content type i am able to get the file name but not the tmp_name of the file found inthe PC

Looking forward...
Thanks in advance for the reply.
Jul 10 '07 #3
pbmods
5,821 Expert 4TB
Heya, newlearner.

Check the 'error' index of your file.
http://www.php.net/manual/en/features.file-upload.php
http://www.php.net/manual/en/feature...oad.errors.php

For security reasons, you cannot upload files via ajax. The only solution is to use an iframe or popup window.
Jul 10 '07 #4
ak1dnar
1,584 Expert 1GB
Hi there,

I didn't try this yet, but may be helpfull for you.
Class: AJAX File Uploader

Thanks,
-Ajaxrand
Jul 10 '07 #5
Hi there,

I didn't try this yet, but may be helpfull for you.
Class: AJAX File Uploader

Thanks,
-Ajaxrand
Yes i tried out file uploader already. the uploading file was ina traditional way with form method and post. I was curious aout doing it in ajax alone.

Thanks for ur valuable suggestions..
- newlearner
Jul 11 '07 #6
ak1dnar
1,584 Expert 1GB
Yes i tried out file uploader already. the uploading file was ina traditional way with form method and post. I was curious aout doing it in ajax alone.

Thanks for ur valuable suggestions..
- newlearner
Oh really,
That's why I said I also didn't try it yet.Then no luck refer to the pbmods's post.
Jul 11 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: JMB | last post by:
Hello, I was wondering if anyone knew of any projects extending the inline upload progress bar to utilize an inpage image uploader with bar, without having to refresh or go to a seperate page,...
6
by: Marko Vuksanovic | last post by:
I am trying to implement a file upload progress indicator (doesn't have to be a progress bar) using atlas... I do realize that the indicator cannot be implemented using Update panel control, but is...
4
by: SammyBar | last post by:
Hi all, I wonder is it possible to upload the content of an <imgfield to a server. The content of the <imgwas downloaded from a web site different from the one it should be uploaded. The image...
3
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be...
3
by: dreamznatcher | last post by:
Hello, I found a script here: http://www.webtoolkit.info/ajax-file-upload.html which supposedly allows you to upload files using AJAX (I'm not an expert). The site claims it's the best way to...
3
by: kksandeep | last post by:
i am using this three files to uplod file. i got this file from net but i think these have some error. i am new to this field plz help the script i found is some helpful but not too that i need ...
1
by: kksandeep | last post by:
i am using this three files to uplod file. i got this file from net but i think these have some error. i am new to this field plz help the script i found is some helpful but not too that i need ...
1
by: gamernaveen | last post by:
Hey guys , am just getting into the AJAX scene and am a noob. I am really worried about Ajax upload , cant figure it out. I have a basic html form , like this <form action="upload.php"...
11
by: kj | last post by:
I would like to convert a form that currently uses the traditional CGI sequence (i.e. the action associated with the form sends a POST request to a server-side CGI script) to one that uses AJAX to...
8
omerbutt
by: omerbutt | last post by:
hi there i have a form with multiple input (type/text ) fields and three inputs(type/file) fields i have to submit the form via ajax because i have multiple forms on this page ,you can say it is a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.