473,765 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repost: Save file on Server - with a twist.

Hi All,

I am reposting this because I need some guidance/advice fairly quickly.

I currently have the following setup for saving a file on the server:

The user runs a VB app on his/her PC. Among other things, the app
prompts the user to select a file (or files). The app then uploads the
file(s) to the web server (effectively pushing the files up). In addition,
the app calls an aspx page and passes the file name (and a few other
bits of data) to the page as query strings. The page then writes the
data to the database. But the user never sees the page - it all happens
"behind the scenes".

Here is what I want to do:

I want to modify the aspx so it pulls the file from the client, as well as
the other things it currently does. The VB app would simply pass all the
relevant info to the page, and the page would do all the work. To prevent
someone calling the page without using the VB app, the app passes an
encrypted string that the page uses to verify that the page has been called
legitimately.

I know I can do this very easily by using a HTML <input type="file">
control. But I don't want to do this because I don't want the user to
ever see the page - the user still needs to use the VB app, I just want
to shift control of the file transfer from the app to the aspx page.

If this presents a security risk, or if it can't be done, I would be
grateful
if someone could explain why.

Cheers,

MG
Nov 17 '05 #1
3 1297
Hi,

I would recommend using a Web Services instead of an ASPX page. You can
easily call your own web service with all the parameters and the file data
from your VB app, at least if you use VB.NET. If you still use VB6, then the
ASPX way may be easier. In this case you still have to use <input
type=file...>, but you can implement the page so that it only allows POSTs
(PageLoad: if(IsPostBack== false) Response.End() or something similar like
that).

Best regards,

Marc Höppner
NeoGeo

"Mr Gordonz" <pa**@mobius.ne t.au> wrote in message
news:OV******** ******@TK2MSFTN GP09.phx.gbl...
Hi All,

I am reposting this because I need some guidance/advice fairly quickly.

I currently have the following setup for saving a file on the server:

The user runs a VB app on his/her PC. Among other things, the app
prompts the user to select a file (or files). The app then uploads the
file(s) to the web server (effectively pushing the files up). In addition, the app calls an aspx page and passes the file name (and a few other
bits of data) to the page as query strings. The page then writes the
data to the database. But the user never sees the page - it all happens
"behind the scenes".

Here is what I want to do:

I want to modify the aspx so it pulls the file from the client, as well as
the other things it currently does. The VB app would simply pass all the
relevant info to the page, and the page would do all the work. To prevent
someone calling the page without using the VB app, the app passes an
encrypted string that the page uses to verify that the page has been called legitimately.

I know I can do this very easily by using a HTML <input type="file">
control. But I don't want to do this because I don't want the user to
ever see the page - the user still needs to use the VB app, I just want
to shift control of the file transfer from the app to the aspx page.

If this presents a security risk, or if it can't be done, I would be
grateful
if someone could explain why.

Cheers,

MG

Nov 17 '05 #2
Hi Marc,

The VB app is indeed VB6, and I have never created a Web Service. I did
actually try the following in the pageload event of the page:

1. Dim txtFilePath As String = Trim(Request.Qu eryString("File Path"))
2. Dim myControl As HtmlControls.Ht mlInputFile = New
HtmlControls.Ht mlInputFile()
3. myControl.Value = txtFilePath
4. Dim strFileName = myControl.Poste dFile.FileName
5. myControl.Poste dFile.SaveAs(st rServerPath & "\media\" & strFileName)

But it didn't like line 3 - the error I got is: Object reference not set to
an instance of an object.

How can I use a <input type=file> control if it is never seen by the user?
I have done a lot research into how this control works, and everything I
have read says that the value property of the control can't be set
programmaticall y (for security reasons). There must be a way for a page to
pull a file off a client computer without the user having to actually see
the page??

Cheers,

MG

"Marc Hoeppner" <ma**********@h otmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,

I would recommend using a Web Services instead of an ASPX page. You can
easily call your own web service with all the parameters and the file data
from your VB app, at least if you use VB.NET. If you still use VB6, then the
ASPX way may be easier. In this case you still have to use <input
type=file...>, but you can implement the page so that it only allows POSTs
(PageLoad: if(IsPostBack== false) Response.End() or something similar like
that).

Best regards,

Marc Höppner
NeoGeo

"Mr Gordonz" <pa**@mobius.ne t.au> wrote in message
news:OV******** ******@TK2MSFTN GP09.phx.gbl...
Hi All,

I am reposting this because I need some guidance/advice fairly quickly.

I currently have the following setup for saving a file on the server:

The user runs a VB app on his/her PC. Among other things, the app
prompts the user to select a file (or files). The app then uploads the
file(s) to the web server (effectively pushing the files up). In addition, the app calls an aspx page and passes the file name (and a few other
bits of data) to the page as query strings. The page then writes the
data to the database. But the user never sees the page - it all happens
"behind the scenes".

Here is what I want to do:

I want to modify the aspx so it pulls the file from the client, as well as
the other things it currently does. The VB app would simply pass all the
relevant info to the page, and the page would do all the work. To prevent
someone calling the page without using the VB app, the app passes an
encrypted string that the page uses to verify that the page has been called legitimately.

I know I can do this very easily by using a HTML <input type="file">
control. But I don't want to do this because I don't want the user to
ever see the page - the user still needs to use the VB app, I just want
to shift control of the file transfer from the app to the aspx page.

If this presents a security risk, or if it can't be done, I would be
grateful
if someone could explain why.

Cheers,

MG

Nov 17 '05 #3
Why first request an empty page?
You don't want to GET an empty page, you want to POST a filled page.
See if you can work out how the "browser" response is encoded
and send that (filename, other bits, file data).

Hans Kesting
"Mr Gordonz" <pa**@mobius.ne t.au> wrote in message
news:uP******** ******@TK2MSFTN GP12.phx.gbl...
Hi Marc,

The VB app is indeed VB6, and I have never created a Web Service. I did
actually try the following in the pageload event of the page:

1. Dim txtFilePath As String = Trim(Request.Qu eryString("File Path"))
2. Dim myControl As HtmlControls.Ht mlInputFile = New
HtmlControls.Ht mlInputFile()
3. myControl.Value = txtFilePath
4. Dim strFileName = myControl.Poste dFile.FileName
5. myControl.Poste dFile.SaveAs(st rServerPath & "\media\" & strFileName)

But it didn't like line 3 - the error I got is: Object reference not set to an instance of an object.

How can I use a <input type=file> control if it is never seen by the user?
I have done a lot research into how this control works, and everything I
have read says that the value property of the control can't be set
programmaticall y (for security reasons). There must be a way for a page to pull a file off a client computer without the user having to actually see
the page??

Cheers,

MG

"Marc Hoeppner" <ma**********@h otmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,

I would recommend using a Web Services instead of an ASPX page. You can
easily call your own web service with all the parameters and the file data
from your VB app, at least if you use VB.NET. If you still use VB6, then the ASPX way may be easier. In this case you still have to use <input
type=file...>, but you can implement the page so that it only allows POSTs
(PageLoad: if(IsPostBack== false) Response.End() or something similar like
that).

Best regards,

Marc Höppner
NeoGeo

"Mr Gordonz" <pa**@mobius.ne t.au> wrote in message
news:OV******** ******@TK2MSFTN GP09.phx.gbl...
Hi All,

I am reposting this because I need some guidance/advice fairly quickly.

I currently have the following setup for saving a file on the server:

The user runs a VB app on his/her PC. Among other things, the app
prompts the user to select a file (or files). The app then uploads the
file(s) to the web server (effectively pushing the files up). In

addition,
the app calls an aspx page and passes the file name (and a few other
bits of data) to the page as query strings. The page then writes the
data to the database. But the user never sees the page - it all happens
"behind the scenes".

Here is what I want to do:

I want to modify the aspx so it pulls the file from the client, as well as the other things it currently does. The VB app would simply pass all the relevant info to the page, and the page would do all the work. To prevent someone calling the page without using the VB app, the app passes an
encrypted string that the page uses to verify that the page has been

called
legitimately.

I know I can do this very easily by using a HTML <input type="file">
control. But I don't want to do this because I don't want the user to
ever see the page - the user still needs to use the VB app, I just want
to shift control of the file transfer from the app to the aspx page.

If this presents a security risk, or if it can't be done, I would be
grateful
if someone could explain why.

Cheers,

MG


Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1755
by: Joe | last post by:
Please repost answer message did not make it last time Hello, Joe here, wanted to get the 411 on this article. I posted in the FrontPage forum but there is never an answer. So I have come here, where all my IIS problems have been solved (Thank YOU!!) I want to create a small utility web site with a logon page and a form connected to an Access database. The article below explains exactly how but when
1
3661
by: JoeS | last post by:
Is there anyway to share a single pch file between projects in VC 7.0? I have 300+ projects each of which creates its own pch. All projects include the exact same header files in the precompiled header. Its takes about 7 seconds to create the precompiled header for each project. That's 35 minutes spent creating precompiled headers for all project! All of the projects use PDB files for debug info. I tried creating Precomp.pch in project...
5
2447
by: Adrian Parker | last post by:
I've got the standard SqlCacheDependency working just fine , ie. I've defined (and encrypted) the connectionStrings section in the web.config, and I've also defined an an sqlCacheDependency in the caching section. So, in my code I add an item to the cache with an sqlCacheDependency, referencing the named sqlCacheDependency in the web.config and the database table it is to be based on (have enabled notificiations for that table). Fine. ...
12
2233
by: Jack | last post by:
Since, I have not got some desired advise, I am reposting this for some asnwer/valuable suggestion. Thanks. THE FOLLOWING IS A PART OF CODE FROM A ASP PAGE <% sql01 = "SELECT COUNT(*) AS reccount FROM Equipmenttbl " sql01 = sql01 & "WHERE Equipmenttbl.GrantID = " & GrantID
4
1361
by: mattmerc | last post by:
Hi all, This is a repost from a week or so ago. I'll try to reformat so it is more clear. I am looking for something in asp .net / vb .net that will export a datagrid to Excel, BUT will save the file on the server (not the client). Can this be done without Excel installed on the server? Is there a was to send the contents of a datagrid as an excel
12
4775
by: =?Utf-8?B?RnJlZU5FYXN5?= | last post by:
Hello, the scenario: There's an ASPX page which shows some text and has three buttons at the bottom: Save, Print and Close. Print and close is done by javascript. But how can I save the page on the client's computer? He/she could do this using the browser (file/save), but I need to have it done by pressing the pushbutton. In my serverside code I get the button-click-event, I also know how to get
0
962
by: Joseph I. Ceasar | last post by:
In an earlier post, someone asked about how to save a page on the client programmatically. I also had to solve this problem and did use Steven's approach. It worked great! Now here is an interesting twist. The page that gets saved to the client contains a several DataGrids components. The data displayed in the grids is filtered by the contents of a separate drop down list box. This allows the client to "download" one page a time.
0
1056
by: Joseph I. Ceasar | last post by:
In an earlier post, someone asked about how to save a page on the client programmatically. I also had to solve this problem and did use Steven's approach. It worked great! Now here is an interesting twist. The page that gets saved to the client contains a several DataGrids components. The data displayed in the grids is filtered by the contents of a separate drop down list box. This allows the client to "download" one page a time.
7
3075
JamieHowarth0
by: JamieHowarth0 | last post by:
Hi guys, I have a pet project I'm trying to get off the ground - I'd like to build an IMAP server. Now, it's one with a bit of a twist, and the twist is that it won't be used to send and receive mail... (told you there was a twist!) I can't explain a huge amount but there are a few basics which I know I have to be able to understand, in this kind of order: I assume it's possible to build a Windows service which can listen on port 143...
0
9398
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
10156
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
10007
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
8831
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
7375
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
6649
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
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2805
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.