|
No, you cannot do that just using Javascript from a browser.
|
|
|
|
|
Hi,
Is there any other method to read without using Active X control?
Thanks
|
|
|
|
|
If all you want to do is get the file from the client to the server, the file input type will do it without any Javascript or ActiveX required.
If you want a bit more control over how it works, you could try something like SWFUpload[^] which uses a Flash movie to give you a progress bar, etc.
|
|
|
|
|
Hi,
Using file input type we can only browse the file, my requirement is
1)Browse the binary file
2)Read the contents of the file
3)store the file contents
4)send the stored file contents to server.
|
|
|
|
|
Using <input type="file"> , the contents of the file is loaded by the browser and sent to the server when you submit the form.
If you want to send the file without submitting the form, you will have to use Flash, or ActiveX, or something similar.
|
|
|
|
|
I was thinking it will only help to browse the path.
Will try. Thanks
|
|
|
|
|
Server side code is in CSP.
Upon using submit button, HttpMethod_Post is called.
In HttpMethod_Post function fopen will not work as path is in local PC and server is in the device
How to copy the data or send the data to server in the device??
Can you please provide code or link.
|
|
|
|
|
|
Hi,
How to get data when
When we use on the webpage we get the option to select the file to be read.
Upon submitting we get the data right but how to copy the recieved data or send to server??
The control goes to below code upon submitting.
if(request->getMethodType() == HttpMethod_Post)
{
}
|
|
|
|
|
Graham Breach wrote: No, you cannot do that just using Javascript from a browser.
Actually... You used to not be able to do it with a browser (was viewed as a security hole). However, with HTML5, browsers have started putting in functionality to trap the filestream when a user selects a file in the input box.
More details are here: http://www.html5rocks.com/en/tutorials/file/dndfiles/[^]
Personally, I still view it as a security problem because I remember all of the details from back in the day, but my opinions don't seem to be falling in line with the new generation of web folks. (yea, yea, get off my lawn and all that)
|
|
|
|
|
Interesting stuff - thanks for the link. I always thought the file upload support was a bit too limited to be honest.
As long as the user still has to choose which files the browser can access this looks like a big improvement.
|
|
|
|
|
I do welcome the drag and drop features (this is probably the most common request I used to have when doing web stuff).
However, I don't like the idea of implicitly agreeing to local file access by just selecting something in a file input field. Especially since Firefox forces you into the file dialog when you focus on the field, and you cannot delete the input field's contents after selecting a file.
|
|
|
|
|
Hi guys
Its my first in this community and I hope someone can help me on this one. I’m currently working on the personalization of the layout of SAP ERP Portal. This Portal Framework uses Iframes to display the current page and/or applications on the Current Page.
Here is a custom draw of a page
---- Custom Componentes Like Menus etc
----- Iframe (InnerPage) – Shows the Current Page
--------This Page can have embedded content and/or More Iframes with Applications
All the Iframes are on the same domain but I only have acess to the innerPage Code and not to the iframes that have the applications.
Now we want the innerpage to automatic resize to the current content. This is being a problem (even after using jQuery Plugins or Resize Scripts) because:
1) The Iframes that have the applications change content height using Ajax/DHTML (not triggering load event) and this resize scripts wont call the resize mechanism.
2) I don’t have access to the applications source
3) On some tests ive made using Scripts ( for example Auto Height Jquery, SSI Dynamic Drive …) some iframes display the same clientHeight and ScrollHeight Even if theres a scrollbar in the browser window.
If there’s anyone there that can help me solve this kind of situations it would be really helpful Thanks
modified on Thursday, September 15, 2011 4:55 PM
|
|
|
|
|
Hi,
iframe object see http://msdn.microsoft.com/en-us/library/ms535258.aspx
The iframe element functions as a document within a document, or like a floating frame.
The frames collection provides access to the contents of an iframe.
Use the frames collection to read or write to elements contained in an iframe.
Example
sColor = document.frames("sFrameName").document.body.style.backgroundColor;
frames collection see http://msdn.microsoft.com/en-us/library/ms537459.aspx
iframe supports ID and NAME attributes too.
|
|
|
|
|
We got the same problem, and our solution is:
1. Set the outer iframe's height to "0"
2. Create a timer to watch every 5 seconds, if the inner iframe's height is larger than an expected value, then set the outer iframe's height to INNER_HEIGHT+15px
3. Kill the timer.
It works, but results in some memory leaks in Internet Explorer.
|
|
|
|
|
How to add a Second Parameter
<%# Eval("Patameter1","return showComment(""{0}"")") %>
please note that the "showComment" is a Jquery function
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
You can using String.Format directly in the binding:
<%# String.Format("return showComment(""{0}"",""{1}"")", "Patameter1", "Parameter2") %>
|
|
|
|
|
hi Mat here is my code with your advice
<asp:ImageButton ID="btnComment" runat="server"
ImageUrl="~/Imgs/comment2.png"
OnClientClick= '<%# String.Format("return showComment(""{0}"",""{1}"")", "Parameter1", ""Parameter2") %>'
ToolTip="Click here to view a Comment" Visible='<%# CheckPendStatus() %>' />
and it gives an Error
Error 149 Comma, ')', or a valid expression continuation expected.
Error 219 Comma, ')', or a valid expression continuation expected.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
You have a second quote before Parameter2.
|
|
|
|
|
hi Matt
thanks for pointing that out it now looks like this
'<%# String.Format("return showComment(""{0}"",""{1}"")", "PARAMETER1", "PARAMETER2") %>'
when i run it it does not take the values but it give me the names of the variable, can i use Eval like this
'<%# String.Format("return showComment(""{0}"",""{1}"")", Eval("PARAMETER1"), Eval("PARAMETER2") %>'
THanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
I used string literals in my example. If you want the variables themselves (and they're at least protected), you can do this:
<%# String.Format("return showComment(""{0}"",""{1}"")", Parameter1, Parameter2) %>
where Parameter1 and Parameter2 are variable names in the page object.
|
|
|
|
|
Thank you very much for you help , i have ended up using it this way and it works
'<%# String.Format("return showComment(""{0}"",""{1}"")", Eval("Parameter1"), Eval("Parameter2")) %>'
Thanks you a Star
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
Thanks. Your code solved my problem
|
|
|
|
|
hello,
i have a big javascript page that needs to be loaded and i was wondering if there is a way to put in a loading screen,
as you know, with images they take time and sometimes other objects on the page can also create the user to wait a while so my question is how do i go about creating a loading screen which will detect when all images, content and functions have been loaded and then disappear when they have finished?
do i use the windows.load event, if so is there such thing as a window.loaded event?
Thanks for all your help i have been searching for hours and still cant really get anywhere
Steve
|
|
|
|
|
You can use jQuery for this one - there's a document.ready event you can handle.
C# has already designed away most of the tedium of C++.
|
|
|
|