473,624 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Uploading file, works in firefox but not IE

21 New Member
Hey everyone,
I've just written some basic code to upload a pdf file from a browser to a server. It works fine when I use Firefox, however when I use IE after clicking the upload button it returns to the index page which I just can't figure out.
If anyone has any idea how to fix this could they let me know, thanks!

(it is added to another page which includes mysql_connect() and all that, it is not a mysql problem but a php one)

Here is my code :

[PHP]
<html>
<head>
<title>Brochure s</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="brochures " action="index.p hp?menu=Brochur es&list_all=1" method="post" enctype="multip art/form-data">
<?php
//If user has clicked view/edit brochures, display list
if(!($list_all) ){
$pdfName = $_POST['brochName'];
$pdf = $_FILES['pdfFile']['name'];
$pdfTemp = $_FILES['pdfFile']['tmp_name'];
$pdfDesc = $_POST['descript'];

$query = "INSERT INTO brochures ('field_1','fie ld_2','field_3' ) VALUES ($pdfName,$pdf, $pdfDesc)" or die("Could not upload: ".mysql_error() );

?>

<table width="68%" height="62" border="0">
<tr>
<td width="42%">Nam e:</td>
<td width="58%"><in put name="brochName " type="text" id="brochName2 " value=""></td>
</tr>
<tr>
<td height="26">Bro chure:</td>
<td><input type="file" name="pdfFile" accept="applica tion/pdf"></td>
</tr>
<tr>
<td height="26">&nb sp;</td>
<td><input type="submit" name="SubmitBro chure" value="Upload" class="sumbit"> </td>
</tr>
</table>
<p>&nbsp;</p>
<p><a href="index.php ?menu=Brochures &list_all=1">Vi ew/Edit Brochures</a></p>

<?php
}
//else display this
else{
$q9 = mysql_query("SE LECT * from brochures ORDER BY id ASC");
$numRows = mysql_num_rows( $q9);
echo("<table>") ;
for($i=0;$i<$nu mRows;$i++){
$name = mysql_result($q 9,$i,1);
$file = mysql_result($q 9,$i,2);
$ID = mysql_Result($q 9,$i,0);
echo("<tr><td>< font size=1><a href=\"index.ph p?menu=Brochure s&deleteNAME=$f ile&DID=$ID\">d elete</a></font></td><td><a href=\"../upload/$file\" target=_blank>$ name</a></td></tr>");

}


echo("</table><br><br>< a href=\"index.ph p?menu=Brochure s\">back to New Brochure</a>");
}

if($SubmitBroch ure){
if($_FILES['pdfFile']['type'] == "applicatio n/pdf"){
$add = "../upload/$pdf";
if(!(file_exist s($add))){
if(move_uploade d_file($pdfTemp ,$add)){
mysql_query("IN SERT INTO brochures (field_1,field_ 2) VALUES ('$pdfName','$p df')") or die ("no mysql: ".mysql_error() );
echo("Brochure uploaded");
}
else echo("pdfTemp: $pdfTemp<br>add : $add<br><br>Cou ld not upload file!");
} else echo("The pdf \"".$pdf."\" already exists. Try renaming your pdf before uploading.");
}
else echo("You must select a pdf file to upload!");
}
?>
</form>
<?php
if($deleteNAME) {
echo($deleteNAM E);
unlink("../upload/".$deleteNA ME);
mysql_query("DE LETE FROM brochures WHERE id='$DID'") or die("Did not delete mysql entry: ".mysql_error() );
echo(" was successfully deleted");
}

?>
</body>
</html>

[/PHP]


Cheers
Jun 26 '07 #1
1 2096
jimmyg123
21 New Member
I actually am now thinking it could have something to do with using two forms... If that's the case sorry!
Jun 26 '07 #2

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

Similar topics

7
8661
by: Roger Withnell | last post by:
I would like to check that an image file, selected by a user using fileUpload, is within certain parameters (width, height, filesize) and to display the image file so that the user can see the correct image has been chosen, before uploading it to the server. http://www.your-community.co.uk/TestImageArray.asp is an extract of the basic functions which work in IE but not in NN (the alerts are just tests to see what is going on). It...
3
3723
by: Ricardo Sanchez | last post by:
Hello, I'm trying to upload images to http://imageshac.us via a Python script. I have looked at the POST request with HTTPLiveHeaders Firefox extension when I upload an image, but I can't figure what's wrong. (if I disable the cookies in the browser, it still works, so it's not that).
2
1402
by: Yanick | last post by:
Hi, I'm writing a class that will enable the user to upload files to the server without reloading the current page (using target="iframe"), and it works just fine in Firefox, but when I test it in IE, first of all, the iframe is not targetted at all, and IE stupidly opens a new window, second the <input type="file" element looses it's name attribute for some reason... I tried using DOM and assigning the element thru innerHTML, both will...
5
2714
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or more documents to share/use during a meeting presentation. What would be the most efficient way to approach this? This is the logic I'm currently considering: Page 1: Meeting Information input with link to a document upload page (this page...
1
4409
by: WeCi2i | last post by:
Okay, I have a problem that has been stumping me for weeks. I have tried many different solutions and this is pretty much my last resort. I have seen a lot of good answers give here so I figured I would give it a try. First of all, I am using Visual Studio 2005 to write my program. I am using C# .NET as the language. I am running Windows XP Professional with all service packs and updates applied. Now, I have been trying to write a...
1
2061
by: thulaseeram | last post by:
I am using iframe to store uploaded images, it is uploading fine in IE but it is not happening in firefox means first time it is uploading image if i try to upload second image it is not calling even java script function and not uploading the image in firefox. I am using this code in the button onclick event "attach_frame.upload();" here attach_frame is the iframe name and id to which the uploaded image should add. please can any one help me to...
1
2013
by: Al7 | last post by:
Hello, I have wrote code that uploads files from user's hard disks to the server and everything works fine in Firefox and Safari, but in Internet Explorer it uploads dummy files and cycles that. So when I try to upload one photo, I get a lot of dummy files on my server and a lot of record in MySQL insted of one record. I guess the problem in JS: <SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT"> <!-- imageWait = new Image();...
10
8071
by: =?Utf-8?B?RGFu?= | last post by:
I'm using a pure ASP upload script to handle file uploading. We run IIS6 and I'm aware of the AspMaxRequestEntityAllowed variable in the metabase. I upped this to allow the file size maximum and it was working for the past couple months. Now all of a sudden in the past couple of days we are seeming to have problems. The upload works fine for anything up to around 2mb (or so it seems). When uploading about 20mb worth (10x2mb files), I...
0
1600
Canabeez
by: Canabeez | last post by:
Hi, I'm uploading a file into protected directory using FileReference. In IE everything's working fine, in Firefox - I'm getting an IE-Authentication popup. I suppose, the request flash is doing is not going under the Firefox session. Anyone knows the solution for this?
0
8172
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8677
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8620
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8335
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5563
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2605
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 we have to send another system
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.