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. - <%
-
-
Randomize
-
fnam= int(rnd() * 1000000) +1
-
fname1=objUpload.fields("map").filename
-
extension=fs.GetExtensionName(fname1)
-
-
response.Write(fname1)
-
response.Write(extension)
-
response.End()
-
-
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
-
%>
See the following 3 lines of code -
<%
-
-
response.Write(fname1)
-
response.Write(extension)
-
response.End()
-
%>
this return no data in ff while return the file name and extension in IE
Any help
Thanks in advance
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
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
<!-- #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
%>
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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.
|
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...
|
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...
|
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=
| |
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...
|
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...
|
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...
|
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"...
|
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...
|
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,...
| |
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...
|
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...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
| |