web application-file upload [duplicate] - file-upload

This question already has answers here:
Get full path of a file with FileUpload Control
(18 answers)
Closed 8 years ago.
I am developing an web application. I am using file upload control to browse files. i have xls file in C:\Mailid.xls path. When i use FileUpload1.PostedFile.FileName command i was get the full path(C:\Mailid.xls).
Today I installed IE 8 After the installation I unable to get the full path of the file what could be the problem Event I uninstalled IE 8. Currently I am using IE 7.
how can i get the fullpath(C:\Mailid.xls) in my project.
Regards
Dhanraj.S

Have you tried using
System.IO.Path.GetFullPath( ... )

Related

Using PHPOffice/phpspreadsheet with PHP+Apache Ubuntu

I use the PhpSpreadsheet library in my Laravel app which runs on a PHP8.2 server + Apache(Laragon) on Windows 10; everything works fine locally. I load an xlsx file, edit it and save with no problem.
But that I deploy the application (the same code) on the online server (PHP2.4+Apache on Ubuntu); the Apache server crashes; after investigating, I realized that it is from the line where we use the library ($reader = IOFactory::createReader('Xlsx'););
Sorry someone help me ..... do not hesitate, I've been trying to solve this problem for 2 weeks in vain

`os.listdir` throws Error2 for `~` [duplicate]

This question already has answers here:
os.makedirs doesn't understand "~" in my path
(3 answers)
Closed 2 years ago.
python version: 3.8
OS: Manjaro KDE
When I called os.listdir('/home/user_name'), it worked fine.
However, when I called os.listdir('~'), it threw FileNotFoundError: [Errno 2] No such file or directory: '~'.
Why os.listdir failed to understand ~?
It's a Bash feature called "tilde expansion". It's a function of the shell, not the OS.
Thus, the os package of python does not recognize ~
You can use it like this :
p = os.path.expanduser('~')
os.listdir(p)
You may refer these links :
Python's os.makedirs doesn't understand “~” in my path
From documentation

Karate : File not found error for js file which is in a reusable feature folder and this feature is called from another feature [duplicate]

This question already has an answer here:
Unable to use classpath or relative path to read json payload data
(1 answer)
Closed 1 year ago.
Karate: I have a reusable feature file which uses a js file.
Folder1
-test feature ( this is calling auth.feature)
Utility folder
auth js file
auth feature
authRunner java
If I run authRunner as a Junit test it runs fine.
But if I call the auth feature file from another folder outside of Utility using read, I get an error that auth js file not found.
Look for info on the this: prefix in the docs here: https://github.com/intuit/karate#reading-files hopefully that solves your issue.
* def foo = read('this:auth.js')

Fatal error: Class 'PDO' not found [duplicate]

This question already has an answer here:
PDO class not found fatal error after upgrading to php 5.3.x
(1 answer)
Closed 9 years ago.
i'm very confused about this
Fatal error: Class 'PDO' not found in /home/itstec2/public_html/pard_config/class/Config.php on line 13
this is my Config.php
<?php
$dbhost=null;
$dbname=null;
$dbuser=null;
$dbpass=null;
$file = __DIR__ ."/config.json";
$array = file_get_contents($file);
$dbConfig=json_decode($array);
$pardConfig=new PDO('mysql:host='.$dbConfig[0].';'.'dbname='.$dbConfig[1],$dbConfig[2],$dbConfig[3]);
?>
Config.php file is working with all other includes.but it's not working with the domain. It has that fatal error .why is that ?
My Domain
If you compare the output of your phpinfo() function to the other directories, where it is working you'll notice that the PDO object is indeed not loaded and that it is using a different php.ini in the directory where it is not working. On the working parts PHP is using /usr/local/lib/php.ini while it is using /home/itstec2/public_html/php.ini in the directory where it isn't working.
Some providers allow you to use different PHP configurations for different parts within the web root. If you use an extra ini file for a specific directory you have to make sure that you have all necessary settings in there.

Chrome wants to download index.php [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Google Chrome forces download of PHP scripts' source
I'm working on Ubuntu 11.04 with Apache2 and PHP 5.3.5.
In my document root, I have two files: a test.php printing phpinfo() and index.php for a fresh download of CodeIgniter 2.0.2
When I try to visit index.php using chrome (11.0.696.57, not Chromium), it tries to download the file. When I visit test.php using Chrome, it displays the file correctly.
When I visit these files with Firefox 4.0 on the same machine, they are BOTH displayed correctly.
Anyone else dealt with this before?
It cannot be a permissions issue as FF displays the files correctly with application type text/html.
What am I doing wrong here?
This question apparently describes the same problem, it's apparently cache related.
Your page should probably return 'Content-type: text/html' at the start (followed by a newline). Your webserver otherwise doesn't know if an image, or text or some movie is getting generated by your php script.