473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Uploading file to a different web platform using ASP.NET/VB.NET and php

Hi, I've been trying to upload file using webclient.uploadfile method
from my IIS webserver to an Apache webserver without any success. On
the Apache server (server that receives the incoming file) I have a
simple php script, getFile.php to receive the file. The script look
like this:

<?php
$uploadDir = '/var/www/Incoming/';
$uploadFile = $uploadDir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
{
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
}
else
{
print "Error receiving file:\n";
print_r($_FILES);
}
print "</pre>";
?>

I know this script work perfectly if I use a standard html with <input
type="file"> method. However, file needs to be sent from an
asp.net page instead of html. People on the newsgroup have been
suggesting me to use webclient.uploadfile method, however, I just could
not get it to work.

Perhaps there is something wrong with my php script or maybe there
something else needs to be done to the webclient. If anybody has came
across with the similar situation, can you show me how to do it both on
the ASP.NET side and php side (or perl)
Thanks
Brian

Jul 17 '05 #1
3 2059
JDS
On Tue, 08 Mar 2005 06:43:39 -0800, brianinbox wrote:
I know this script work perfectly if I use a standard html with <input
type="file"> method. However, file needs to be sent from an
asp.net page instead of html. People on the newsgroup have been
suggesting me to use webclient.uploadfile method, however, I just could
not get it to work.

Perhaps there is something wrong with my php script or maybe there
something else needs to be done to the webclient. If anybody has came
across with the similar situation, can you show me how to do it both on
the ASP.NET side and php side (or perl)


Huh? Are you saying that the web page in which the form that the user will
interact with is generated on an ASP.NET server? And that the
form's action="" points to a PHP script on an Apache server?

Ultimately, my understanding is that the ASP.NET page sent to the browser
is just plain 'ol HTML. So why can't you just get the ASP page to generate
the appropriate HTML?

Do this: Compare the final versions of each page -- the HTML one that
works and the ASP.NET one that doesn't. If there are any differences,
then there is your problem.

later...

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 17 '05 #2
The user interact with an ASP.NET form and on that form it has many
other asp.net webcontrols. The action does not point to a php script
on an Apache server.
After user click the "Upload" button, the request is sent back to the
IIS server and then post the file from user's machine to an Apache
server.

Jul 17 '05 #3
JDS
On Tue, 08 Mar 2005 09:13:32 -0800, brianinbox wrote:
After user click the "Upload" button, the request is sent back to the
IIS server and then post the file from user's machine to an Apache
server.


Why? Why not just send the request directly to the Apache server?

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 17 '05 #4

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

Similar topics

5
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...
7
by: John Machin | last post by:
Sorry in advance if this is not the correct forum ... I'm trying to upload what appears to be a perfectly OK zip file as a "source" file type to PyPI, and am getting this response: Error......
4
by: brianinbox | last post by:
Hi, I've been trying to upload file using webclient.uploadfile method from my IIS webserver to an Apache webserver without any success. On the Apache server (server that receives the incoming...
13
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...
0
by: TJ | last post by:
Hi, I've written code web-based uploading and downloading. Here is some code for it. For saving file into MS-SQL database, SaveFileIntoDB(HttpPostedFile file) { int fileLength =...
5
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...
0
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,...

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.