473,399 Members | 3,603 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,399 software developers and data experts.

File upload woes

I am trying to do the following:

* receive three image files one at a time
* validate that it is a valid image type, size
* as each is received, I store the image, then show the image
* when all are received and validated, I email them to myself

What seems to happen is that when I run my C# script to validate and save
the file it does a post back and the FileUpload control is then blank.

Also, I try assigning the url of the saved file to my image.imageurl
property thus:

"file:///c:\mypath\myfile.jpg" but it does not show the file. It seems that
it needs an "http://" address. Is that true?

Thanks,

--
Bill Ross
http://bibleshockers.com
Bible Shockers! A collection of disturbing observations of and about the
Bible.
Oct 25 '07 #1
3 1159
Yes,

Remember that the browser runs on your computer so if you point your browser
to file:///c:\mypath\myfile.jpg it will search the file on YOUR computer not
on the server (and actually it likely even doesn't work as AFAIK by default
a web page can't reference local content any more for safety reasons).

You'll have to use the url of the file on your website...

--
Patrice
"Bill Ross" <bi******@bibleshockers.coma écrit dans le message de news:
2C**********************************@microsoft.com...
>I am trying to do the following:

* receive three image files one at a time
* validate that it is a valid image type, size
* as each is received, I store the image, then show the image
* when all are received and validated, I email them to myself

What seems to happen is that when I run my C# script to validate and save
the file it does a post back and the FileUpload control is then blank.

Also, I try assigning the url of the saved file to my image.imageurl
property thus:

"file:///c:\mypath\myfile.jpg" but it does not show the file. It seems
that it needs an "http://" address. Is that true?

Thanks,

--
Bill Ross
http://bibleshockers.com
Bible Shockers! A collection of disturbing observations of and about the
Bible.


Oct 25 '07 #2
Thanks, Patrice.

What about the fact that the file name disappears from the filupload control
when I do my validation using C# script?

--
Bill Ross
http://bibleshockers.com
Bible Shockers! A collection of disturbing observations of and about the
Bible.
"Patrice" <http://www.chez.com/scribe/wrote in message
news:#l**************@TK2MSFTNGP03.phx.gbl...
Yes,

Remember that the browser runs on your computer so if you point your
browser to file:///c:\mypath\myfile.jpg it will search the file on YOUR
computer not on the server (and actually it likely even doesn't work as
AFAIK by default a web page can't reference local content any more for
safety reasons).

You'll have to use the url of the file on your website...

--
Patrice
"Bill Ross" <bi******@bibleshockers.coma écrit dans le message de news:
2C**********************************@microsoft.com...
>>I am trying to do the following:

* receive three image files one at a time
* validate that it is a valid image type, size
* as each is received, I store the image, then show the image
* when all are received and validated, I email them to myself

What seems to happen is that when I run my C# script to validate and save
the file it does a post back and the FileUpload control is then blank.

Also, I try assigning the url of the saved file to my image.imageurl
property thus:

"file:///c:\mypath\myfile.jpg" but it does not show the file. It seems
that it needs an "http://" address. Is that true?

Thanks,

--
Bill Ross
http://bibleshockers.com
Bible Shockers! A collection of disturbing observations of and about the
Bible.


Oct 25 '07 #3
The content of an input type=file is read only... Not sure what you do
exactly but for example if a postback is involved the value can't be
restored (it always has to be defined by the user for safety reasons)...

--
Patrice
"Bill Ross" <bi******@bibleshockers.coma écrit dans le message de news:
04**********************************@microsoft.com...
Thanks, Patrice.

What about the fact that the file name disappears from the filupload
control when I do my validation using C# script?

--
Bill Ross
http://bibleshockers.com
Bible Shockers! A collection of disturbing observations of and about the
Bible.
"Patrice" <http://www.chez.com/scribe/wrote in message
news:#l**************@TK2MSFTNGP03.phx.gbl...
>Yes,

Remember that the browser runs on your computer so if you point your
browser to file:///c:\mypath\myfile.jpg it will search the file on YOUR
computer not on the server (and actually it likely even doesn't work as
AFAIK by default a web page can't reference local content any more for
safety reasons).

You'll have to use the url of the file on your website...

--
Patrice
"Bill Ross" <bi******@bibleshockers.coma écrit dans le message de news:
2C**********************************@microsoft.com...
>>>I am trying to do the following:

* receive three image files one at a time
* validate that it is a valid image type, size
* as each is received, I store the image, then show the image
* when all are received and validated, I email them to myself

What seems to happen is that when I run my C# script to validate and
save the file it does a post back and the FileUpload control is then
blank.

Also, I try assigning the url of the saved file to my image.imageurl
property thus:

"file:///c:\mypath\myfile.jpg" but it does not show the file. It seems
that it needs an "http://" address. Is that true?

Thanks,

--
Bill Ross
http://bibleshockers.com
Bible Shockers! A collection of disturbing observations of and about the
Bible.



Oct 26 '07 #4

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

Similar topics

4
by: Tihon | last post by:
Hello! I again need your help, just can't understand whats going on. Got this upload pictures form and it's having problem handling large files (~1.5 - 2 MB). Everything works fine if i just...
2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
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...
2
by: mark | last post by:
How do I detect that a particular form element is a file upload or if the file upload has worked? In the Python cgi module documentation I found suggested code... form = cgi.FieldStorage()...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
2
by: hotflash | last post by:
Hi All, I found the best pure ASP code to upload a file to either server and/or MS Access Database. It works fine for me however, there is one thing that I don't like and have tried to fix but...
1
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one...
6
Jacotheron
by: Jacotheron | last post by:
I need a PHP script that can upload music files (mp3). The script is for a home project I have started a while ago. I have a MySQL database of all the music that I have. Other computers on the...
7
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and...
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
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,...
0
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...
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,...
0
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...

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.