473,800 Members | 2,497 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

uploading file using javascript method on same page.

Fary4u
273 Contributor
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(myfor m, windowname)
{
if (! window.focus)re turn true;
window.open('', windowname, 'height=200,wid th=400,scrollba rs=yes');
myform.target=w indowname;
return true;
}
</SCRIPT>

<body>
<!-- Action=upload.a sp give you result back with file name which u uploaded. !-->
<FORM METHOD=POST ACTION="http://www.fastcomshos ting.co.uk/click/upload.asp" onSubmit="popup form(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.fastcomshos ting.co.uk/click/upload.asp" method=post enctype="multip art/form-data" name="form">
<div id=ComboExample ><p>Please click a button</p></div>
<input type="file" name="fName" value="" size="50" onchange="docum ent.getElementB yId('ComboExamp le').innerHTML= '&lt;iframe src=&quot;uploa d.asp&quot; width=&quot;100 %&quot; height=&quot;10 0&quot; scrolling=&quot ;no&quot; frameborder=&qu ot;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 1859

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

Similar topics

1
1850
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
4324
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...
2
1436
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" runat="server"> I looked at some of the upload examples and they all seem to have the uploading on a page by itself where the form is set to something like: <form Method="Post" EncType="Multipart/Form-Data" RunAt="Server">
5
2057
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 semi-slick using a hidden frame to post the form to. However, both of these approaches carry browser-compatibility risks. It's my understanding that my server-side code doesn't execute until the file is completely received by IIS, so I can't...
5
2732
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...
38
4035
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 single <scripttag, but have that external JS file insert into ITSELF the contents of five others? Something like: /*start external.js*/
1
4417
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
1431
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
367762
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 needs to store entire files, the preferred method is to save the file onto the server’s file-system, and store the physical location of the file in your database. This is generally considered to be the easiest and fastest way to store files. ...
0
9691
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
9551
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
10505
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
10276
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...
0
10035
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
9090
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
6813
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
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2945
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.