473,397 Members | 2,068 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,397 software developers and data experts.

Firefox problem - file upload doesn't return filename

106 100+
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 3235
jhardman
3,406 Expert 2GB
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 Expert 2GB
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 100+
<!-- #include file="clsUpload.asp"-->

<%
server.ScriptTimeout = 20000
Dim fs
Dim objUpload, lngLoop
Dim FileName,filePath
dim fname
Dim new_name
Set objUpload = New clsUpload
Randomize
fnam= int(rnd() * 1000000) +1
fname1=objUpload.fields("map").filename
extension=fs.GetExtensionName(fname1)

fname1=fnam &"." & extension
while(fs.FileExists(Server.MapPath(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
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...
5
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. ...
13
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...
4
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...
4
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
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...
1
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...
1
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...
3
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...
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?
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
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...
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
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,...
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...

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.