Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2007

Tip: Looking for answers? Try searching our database.

Invoke a remote button on a web page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shantanu - 14 Jun 2007 05:19 GMT
Dear All
  I have a very urgent requirement if somebody can
help!!!!!!!!!!!!!!!!!!!!!!

i have a requirement to upload a file through a remote web page.
Speaking more clearly i have a excel addin that will pick some values
from the cells and create a text file, after that using a web page url
it will try to uplaod that text file. The Webpage consists of a File
control and a Button to Import. Now the above process will be silent
and will be not visible to the user. I have tried with the querystring
using the POST meathod of httpWebRequest, but the querystring does not
provide any facility to specify the file location.

Kindly help
Thanx
shantanu
Jeff Hopper - 14 Jun 2007 14:52 GMT
Shantanu,

You've mentioned an Excel addin and a web page, but it's not clear where you
need to initiate the upload. If you need to upload the file from Excel via a
URL, then what is the purpose of the controls on the web page? Can you
clarify exactly what you need help with, where you would like this code to
be, etc?

Thanks,
Jeff

> Dear All
>   I have a very urgent requirement if somebody can
[quoted text clipped - 12 lines]
> Thanx
> shantanu
Patrice - 15 Jun 2007 12:25 GMT
Try :
http://msdn2.microsoft.com/en-us/library/system.net.webclient.uploadfile(VS.80).aspx
to create an HTTP query that will post the file to a server side page.

Server side you never have access to client side files. So when you upload a
file, the browser uses the location entered by the user and sends the file
content to the server as part of the resquest. This is what this method
does.

It should allow to directly post. If you wanted to still ask for
confirmation you can't this way (an input type=file tag is not writable for
safety reason, else a site could write the file location and grab files
without asking to users).

Also I would likely do a specif page for non ui post (for example to avoid
having possible problme with viewstates). You can get the file server side
by using Request.Files even if you don't have a control on the page.

---
Patrice

> Dear All
>   I have a very urgent requirement if somebody can
[quoted text clipped - 12 lines]
> Thanx
> shantanu

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.