473,775 Members | 2,327 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

uploading a file! can i prevent the page from being refreshed?

130 New Member
hello all
is it possible to upload a file without refreshing the page?

snippt anyone?
an idea?

thanks
Nov 26 '07 #1
5 1166
pbmods
5,821 Recognized Expert Expert
Heya, Amzul.

To do this, you'll need to use an iframe.

http://www.google.com/search?q=ajax+...UTF-8&oe=UTF-8
Nov 26 '07 #2
Amzul
130 New Member
thanks man
that nice..... useing ajax for uploading

cant wait to try it out
Nov 26 '07 #3
pbmods
5,821 Recognized Expert Expert
Heya, Amzul.

Let us know if it gives you any trouble :)
Nov 26 '07 #4
Amzul
130 New Member
sorry for 2 in a row....

can someone explian me the syntax of this :

Expand|Select|Wrap|Line Numbers
  1. AIM = {
  2.  
  3.     frame : function(c) {
  4.  
  5.         var n = 'f' + Math.floor(Math.random() * 99999);
  6.         var d = document.createElement('DIV');
  7.         d.innerHTML = '<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'" onload="AIM.loaded(\''+n+'\')"></iframe>';
  8.         document.body.appendChild(d);
  9.  
  10.         var i = document.getElementById(n);
  11.         if (c && typeof(c.onComplete) == 'function') {
  12.             i.onComplete = c.onComplete;
  13.         }
  14.  
  15.         return n;
  16.     },
i took it from here
whats AIM a class?
whats frame : means? is it like 'go to' like an anchor?
why there is a ',' (comma) affter the end of the function?

and in the main html
Expand|Select|Wrap|Line Numbers
  1. <form action="index.php" method="post" onsubmit="return AIM.submit(this, {'onStart' : startCallback, 'onComplete' : completeCallback})">
the way i underrstand, it calls to a sequence of function. am i right?
Nov 27 '07 #5
pbmods
5,821 Recognized Expert Expert
Heya, Amzul.

In this case, AIM is a generic object that contains an element named 'frame'. That element is a function object (see this article).

The syntax for a JavaScript object (known as JSON) is:
Expand|Select|Wrap|Line Numbers
  1. variable =
  2.     {
  3.         'element name'  : 'value',
  4.         'name'          : 'James',
  5.         'age'           : 32,
  6.         'etc.'          : function() { return 5; }
  7.     };
  8.  
  9. alert(variable.name);       // 'James'
  10. alert(variable.age);        // 32
  11.  
  12. alert(variable['etc.']);    // 'function() { return 5; }'
  13. alert(variable['etc.']());  // 5
  14.  
Nov 27 '07 #6

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

Similar topics

5
17483
by: ok | last post by:
Hello, Q: How do I get image width and height before uploading an image? This because, I want to restrict people uploading huge files. Thanks in advance
9
2377
by: R. Rajesh Jeba Anbiah | last post by:
Q: How should I handle file upload? A: File uploading requires HTML form of content type "multipart/form-data". The file content has to be POSTed/submitted via the form and once the file is uploaded, it will be available at the "upload_tmp_dir" (usually /tmp) directory. Then you may move that file to another directory using move_uploaded_file(); file name will be available in the superglobal $_FILES. Refer:...
5
7838
by: Kevin Ollivier | last post by:
Hi all, I've come across a problem that has me stumped, and I thought I'd send a message to the gurus to see if this makes sense to anyone else. =) Basically, I'm trying to upload a series of files via FTP. I'm using ftplib to do it, and for each file I'm using transfercmd("STOR " + myfile) to get the socket, then uploading 4096 bytes at a time and providing status updates via a GUI interface. Finally, I close the socket, set it to...
5
5477
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and replacing it with a button of my own background color and text. The file paths I'd like displayed in a textarea and then the files uploaded at once.
1
1444
by: psb | last post by:
WHO HAS THE BEST COMPONENT FOR FILE UPLOAD? HELP!? has anyone achieved 100% success with HTTP uploading with Mac clients??? I thought the whole <input type="file" .../> was a w3c standard that goes back 10 years!! I have been doing web development with either asp or asp.net since 1998. I have implemented almost every methodology for file uploading -> com+, asp w/ado.stream, asp.net, asp.net private assemblies. In my past...
13
4322
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...
3
2642
by: Jason Chu | last post by:
I've written a file uploading part of my application using the IHttpModule. So now, I don't have the memory problem of uploading something big. Problem: I can't find which function I have to override, so that I can catch the event when while user's uploading a file, then suddenly closes the browser. In that case, couple things happens: 1) ASPNET will start eating up the uploading file on memory instead of on disk (so picture a...
3
2069
by: Dean Richardson | last post by:
Hi, I'm having trouble uploading files via a PHP script. Whenever I upload a file greater than 10K, the file gets corrupted. However, text files upload OK. When I check the FTP Server log I find this:
3
1915
ganesanji
by: ganesanji | last post by:
hi all, I have written a php coding for uploading a file to a specific folder or location in server which is a Linux server. I think the coding for file uploaing is correct. But it does not work properly. That means the file is not uploaded to the specified location. It always executes the "else" condition in my coding. I think the problem is lieing in the specifed path which is the target path for file uploading. I could not find out...
0
2210
by: Raj | last post by:
Hello, I am planning to provide the Pause/Resume while uploading files. Our site is using both java applet and activex to do this. The list of selected files will be stored in an encrypted file using SHA256 (I have taken the code from: http://www.vbforums.com/showthread.php?s=&threadid=232284)
0
9622
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
10270
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...
1
10051
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
8940
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...
1
7464
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6718
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
5486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4018
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
3
2854
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.