473,467 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

File upload in ajax with PHP

67 New Member
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 2753
mrbadboy
21 New Member
do u using any other Content-type except multipart/form-data?
Jul 10 '07 #2
newlearner
67 New Member
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 Recognized Expert Expert
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 Recognized Expert Top Contributor
Hi there,

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

Thanks,
-Ajaxrand
Jul 10 '07 #5
newlearner
67 New Member
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 Recognized Expert Top Contributor
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: 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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.