473,395 Members | 1,530 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,395 software developers and data experts.

uploading file using javascript method on same page.

Fary4u
273 100+
Hi Guys

i'm trying to upload a file, i've tried 3 different methods but still not work out i don't know how to over come this problem

hidden file value, multiple form or popup uploading.

1-

<SCRIPT TYPE="text/javascript">
function popupform(myform, windowname)
{
if (! window.focus)return true;
window.open('', windowname, 'height=200,width=400,scrollbars=yes');
myform.target=windowname;
return true;
}
</SCRIPT>

<body>
<!-- Action=upload.asp give you result back with file name which u uploaded. !-->
<FORM METHOD=POST ACTION="http://www.fastcomshosting.co.uk/click/upload.asp" onSubmit="popupform(this, 'join')">
<input type="file" name="fName" > <input type=submit value="Upload . ">
</FORM>

other method i'm using is

2-

form within another form which is onchange method can upload inline frame by passing value for example.

<FORM ACTION="http://www.fastcomshosting.co.uk/click/upload.asp" method=post enctype="multipart/form-data" name="form">
<div id=ComboExample><p>Please click a button</p></div>
<input type="file" name="fName" value="" size="50" onchange="document.getElementById('ComboExample'). innerHTML='&lt;iframe src=&quot;upload.asp&quot; width=&quot;100%&quot; height=&quot;100&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot;&gt;&lt;/iframe&gt;'">
</FORM>

3rd method i've tried is to passing textbox value as file path into file for example

<input type="hidden" value="c:\test.jpg" name=hid>
<input type="file" name="fName" value="document.formname.hid" style="display: none">

there is no problem by passing value into value but type as a file it's not take the value.

if any thing else that generate result on the same page by passing value please let me know

Regards
Jul 18 '07 #1
0 1834

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

Similar topics

1
by: Asha | last post by:
greetings, i need to upload an .xls file using a secure connection. so i though of using https... can i know how this can be done?
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...
2
by: tshad | last post by:
I have a page that I am using for multiple uses that includes reposting of the page as well as going to another page where the "form" tag would be something like: <form id="something"...
5
by: Jared | last post by:
I'd like to display a "please wait while your file is uploading" page immediately after someone uploads a large-ish file. I know I could make something really slick with DHTML, or even something...
5
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...
38
by: Neo Geshel | last post by:
I am seeking a method to load one JS file directly into another, *without* having to dynamically write <scripttags. Is there any method whereby I can call only one external JS file using a ...
1
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...
1
by: seeing | last post by:
hello :) i have managed to get my php to work as in, an uploader user page 1) upload.php ||| amount of files to be uploaded <html> <head> <title>Upload_Amount</title>
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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...

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.