473,765 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox problem - file upload doesn't return filename

106 New Member
I have Two asp pages

addfiles.asp
insert.asp

addfiles.asp is used to browse the files which i want to upload to server.

in IE both the pages run and the files uploads ok.

There is problem in firefox.

I have the following code for upload process.

Expand|Select|Wrap|Line Numbers
  1. <%
  2.  
  3. Randomize
  4. fnam= int(rnd() * 1000000) +1 
  5. fname1=objUpload.fields("map").filename
  6. extension=fs.GetExtensionName(fname1)
  7.  
  8. response.Write(fname1)
  9. response.Write(extension)
  10. response.End()
  11.  
  12. fname1=fnam &"." & extension
  13. while(fs.FileExists(Server.MapPath(fname1)))
  14. Randomize
  15. fnam= int(rnd() * 1000000) +1 
  16. fname1=fnam &"." & extension
  17. wend
  18. if fname1<>"" then
  19. filePath = Server.MapPath("../downloads/upload_map/")&"/" & fname1
  20. objUpload("map").SaveAs filePath
  21. map="upload_map/"& fname1
  22. end if
  23. %>
See the following 3 lines of code
Expand|Select|Wrap|Line Numbers
  1. <%
  2.  
  3. response.Write(fname1)
  4. response.Write(extension)
  5. response.End()
  6. %>
this return no data in ff while return the file name and extension in IE

Any help
Thanks in advance
Nov 12 '07 #1
3 3252
jhardman
3,406 Recognized Expert Specialist
Unfortunately, the response that browsers send to the server when you use the file input is not standardized. I recently wrote an article on how I upload files, maybe it will help out. Check out the ASP articles section (there are only 10 or so articles, it won't be hard to find the right one)

Jared
Nov 13 '07 #2
jhardman
3,406 Recognized Expert Specialist
BTW, I'd love to see your whole code, since you obviously took a different approach than I did.

Jared
Nov 13 '07 #3
Hamayun Khan
106 New Member
<!-- #include file="clsUpload .asp"-->

<%
server.ScriptTi meout = 20000
Dim fs
Dim objUpload, lngLoop
Dim FileName,filePa th
dim fname
Dim new_name
Set objUpload = New clsUpload
Randomize
fnam= int(rnd() * 1000000) +1
fname1=objUploa d.fields("map") .filename
extension=fs.Ge tExtensionName( fname1)

fname1=fnam &"." & extension
while(fs.FileEx ists(Server.Map Path(fname1)))
Randomize
fnam= int(rnd() * 1000000) +1
fname1=fnam &"." & extension
wend
if fname1<>"" then
filePath = Server.MapPath( "../downloads/upload_map/")&"/" & fname1
objUpload("map" ).SaveAs filePath
map="upload_map/"& fname1
end if
%>
Nov 14 '07 #4

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

Similar topics

2
3930
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give them a caption, storing the caption and filename in a text file. It's a bit buggy when removing the photos and captions from the file, and also in displaying them on the delete page. you can see it in action at www.4am.com.au/gallery/upload.php...
5
5468
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. I want to develop a webpage where people can send attachments that are stored on their local PC.
13
4320
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
4
4487
by: Matt Jensen | last post by:
Howdy I've got a rather strange issue occuring. I used forms based .NET authentication, although I'm also setting some session variables when people login. However, I've found when people use one of my webform pages which includes a button that pops up a window where you can upload files, if you upload files in this popup window, it seems to somehow clear out all of the session variables and the users get logged out. However, if...
4
5897
by: Jim Michaels | last post by:
after a file upload, $_FILES is not populated but $_POST is. what's going on here? $_POST=C $_POST=C $_POST=C $_POST=C:\\www\\jimm\\images\\bg1.jpg $_FILES= $_FILES= $_FILES=
15
4324
by: Larry Bud | last post by:
I rarely crosspost, but this affects both ASP and Javascript REALLY odd bug that I ran across in ASP 3.0. I have an input type of file, user clicks browse, then places his cursor in the filename, puts a space at the end of the file, and uploads it. Web server doesn't translate the MIME type of document properly because it doesn't end with a valid extension, yet the file itself uploads successfully. I'm using SAFileUP for my uploading...
1
5457
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one group get automatically re-directed after uploading. However, this member group never gets the benefit of knowing if they've uploaded an incorrect file size or incorrect file extension. Members from the second group do see the "exceeds max file...
1
47483
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
3
4433
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine when iam using a normal web page... but can't in content page.... Code in Master Page <%@ Master Language="C#" AutoEventWireup="true" CodeFile="submaster.master.cs" Inherits="submaster" %> <%@ Register Assembly="AjaxControlToolkit"...
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9399
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
10163
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
10007
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
9957
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
9835
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
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

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.