473,379 Members | 1,355 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,379 software developers and data experts.

Problem with file path

I'm getting the file path via webservice using following code:-
FileInfo fInfo = new FileInfo(filename);
return fInfo.FullName;

the return file backed as C:\test\images\1.jpg

in application side .aspx.cs file i stored the returned path in public
variable to read it from javascript function , when read the filename in js
function as follows

<%= sFileName %> the path trim and be c:test
why? and what can I do to solve this problem?
Nov 19 '05 #1
3 1591
I'm not sure,
But perhaps you should convert C:\test\images\1.jpg
to C:\\test\\images\\1.jpg before passing to java script.

--
Saber S.
http://maghalat.com
"Raed Sawalha" <Ra*********@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
I'm getting the file path via webservice using following code:-
FileInfo fInfo = new FileInfo(filename);
return fInfo.FullName;

the return file backed as C:\test\images\1.jpg

in application side .aspx.cs file i stored the returned path in public
variable to read it from javascript function , when read the filename in
js
function as follows

<%= sFileName %> the path trim and be c:test
why? and what can I do to solve this problem?

Nov 19 '05 #2
are there other solutions? because i will have to get into each file and
place \\\
after each \ in file path
"Saber" wrote:
I'm not sure,
But perhaps you should convert C:\test\images\1.jpg
to C:\\test\\images\\1.jpg before passing to java script.

--
Saber S.
http://maghalat.com
"Raed Sawalha" <Ra*********@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
I'm getting the file path via webservice using following code:-
FileInfo fInfo = new FileInfo(filename);
return fInfo.FullName;

the return file backed as C:\test\images\1.jpg

in application side .aspx.cs file i stored the returned path in public
variable to read it from javascript function , when read the filename in
js
function as follows

<%= sFileName %> the path trim and be c:test
why? and what can I do to solve this problem?


Nov 19 '05 #3
Try it:

FileInfo fInfo = new FileInfo(filename);
string fn = fInfo.FullName;
fn.Replace("\","\\"); // or fn.Replace("\","\\\") I don't know!
return fn;
--
Saber S.
http://maghalat.com
"Raed Sawalha" <Ra*********@discussions.microsoft.com> wrote in message
news:02**********************************@microsof t.com...
are there other solutions? because i will have to get into each file and
place \\\
after each \ in file path
"Saber" wrote:
I'm not sure,
But perhaps you should convert C:\test\images\1.jpg
to C:\\test\\images\\1.jpg before passing to java script.

--
Saber S.
http://maghalat.com
"Raed Sawalha" <Ra*********@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
> I'm getting the file path via webservice using following code:-
> FileInfo fInfo = new FileInfo(filename);
> return fInfo.FullName;
>
> the return file backed as C:\test\images\1.jpg
>
> in application side .aspx.cs file i stored the returned path in public
> variable to read it from javascript function , when read the filename
> in
> js
> function as follows
>
> <%= sFileName %> the path trim and be c:test
> why? and what can I do to solve this problem?


Nov 19 '05 #4

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

Similar topics

5
by: Rene Olsthoorn | last post by:
Dear readers, py2exe has a problem including libxml2. Not at building time, but at runtime. The libxml2.dll cannot be loaded... Is there anyone that NOT has the problem? (and can you drop me...
2
by: Egor Bolonev | last post by:
hi all my program terminates with error i dont know why it tells 'TypeError: run() takes exactly 1 argument (10 given)' =program==================== import os, os.path, threading, sys def...
4
by: moondaddy | last post by:
Using vb.net I need to download image files to the client browser where they can save to disk. Below is some sample code I'm using. when I run this the File Download window in the browser says: ...
8
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my...
5
by: Sakharam Phapale | last post by:
Hi All, I am using an API function, which takes file path as an input. When file path contains special characters (@,#,$,%,&,^, etc), API function gives an error as "Unable to open input file"....
4
by: Steve Jorgensen | last post by:
Generally, it is the case that space characters in the names of things can cause difficulties, and removing the spaces can make things work more smoothly, but I recently found a reverse case. I...
8
by: =?Utf-8?B?TWlrZSBSYW5k?= | last post by:
I am trying to get a list of files from a specified directory using the System.IO namespace classes, and then use that list as the datasource for a GridView. I have been able to do this...
3
by: =?Utf-8?B?UnVkeQ==?= | last post by:
Hello All! I may have posted this problem before, but it was awhile ago. I'm working in VS 2003. I have 10 file watch process going. It seems that I can only about 6or 7 to run at the same...
5
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
Before you respond with "just use GetShortPathName" please read the rest. We have an application that places files on a file server using mapped drives as it's path of choice. The reason for...
2
by: JohnLorac | last post by:
Hello, I'm trying to load and write file on local disc drive using signed javascript file. But I have experienced problem running this url: ...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.