|
|
Hi Vasudevan Deepak Kumar
Thanks for sent me a web link but it speaks about .NET ..I want this to be done with ASP
let me know if you have any idea....
N.Rajakumar B.E.,
Application Developer,
|
|
|
|
|
Concept is same. .NET BCL actually wraps around the same CDO object.
|
|
|
|
|
Hi there,
I want to upload a file from the local pc to the server by using php.
I am getting following things in php from html "":
$_FILES['browsefile'] = Array
$_FILES['name'] = WorkReport.xls
$_FILES['type'] = application/vnd.ms-excel
$_FILES['size'] = 13824
$_FILES['tmp_name'] = c:/wamp/tmp\php7B.tmp
$_FILES['error'] = 0
$ftp = ftp_connect("ftp.example.com");
$ftpLogin = ftp_login($ftp, "user_name", "*****");
$fileName = $uploadFileName['name'];
$fp = fopen($fileName, 'r');
ftp_fput($ftp, $fileName, $fp, FTP_ASCII)
by giving this I am getting following error:
Warning: fopen(WorkReport.xls) [function.fopen]: failed to open stream: No such file or directory
Warning: ftp_fput() expects parameter 3 to be resource, boolean given.
Can you please tell me how can I solve this problem??
Or if you have any other idea reguarding uploading a file from local pc to the server then please tell me with the sample code if posible.
Thank you in advance.
|
|
|
|
|
You want to use $_FILES['tmp_name'], this is where the file is temporarily stored until the request is processed. The file name just tells you what the file was called before it was uploaded. NB: bear in mind that after the script has finished processing the temp file will be deleted, you have to move it manually if you want to keep it.
|
|
|
|
|
Actually I dont want that temporary file I just want to copy that file to the server. Then after if temporary file deletes then its ok for me.
But I don't know how can I copy that file to the server.
|
|
|
|
|
Probably, but can you please go to the suggestion forum and endorse my idea for a PHP forum.
Anyway your problem is that you seem not to have opened the "TEMPORARY FILE". The fopen should open the temp location where the uploaded file is stored. Does that work?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Hi I tried by another way that is
$ftp = ftp_connect("ftp.example.com");
$ftpLogin = ftp_login($ftp, "user_name", "*****");
$fileName = basename($uploadFileName['name']);
$uploadDir = "ftp://ftp.example.com/TempUpload/".$uploadFileName['name'];
move_uploaded_file ($uploadFileName['tmp_name'], $uploadDir);
ftp_close($ftp);
yet it is giving me following errors:
Warning: move_uploaded_file(ftp://ftp.example.com/TempUpload/Case Studies for uploading.doc) [function.move-uploaded-file]: failed to open stream: Invalid argument
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'c:/wamp/tmp\php90.tmp' to 'ftp://ftp.example.com/TempUpload/Case Studies for uploading.doc'
Can you tell me how I can solve this problem or why it is giving me such kind of error?
|
|
|
|
|
Your problem there is that you have not logged into the FTP server where to want to store the files. Try:
$uploadDir = "ftp://username:password@ftp.example.com/TempUpload/".$uploadFileName['name'];
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Thank you.
Your single line of code is removing my four lines of warning.
Thank you so much.
|
|
|
|
|
Hey no problem, Glad I could help you.
I am currently asking the site owners here to put a PHP forum in. Can you post your opinions here: Linkety[^]
Brad
Australian
- Captain See Sharp on "Religion"
any half intelligent person can come to the conclusion that pink unicorns do not exist.
|
|
|
|
|
Save the file uploaded and then use the saved one for FTP.
|
|
|
|
|
Does anyone know how to permanently add a toolbox tab to Visual Studio such that the Ajax Controls are loaded for every project?
|
|
|
|
|
|
Ask one.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Don't use caps
Don't use the word urgent
Post your code
Use code and pre tags!
Don't use the word 'doubt' when you meant to use 'question'
|
|
|
|
|
|
I have a database(mydb) with userid fild data.
and i want to use AspLogin control and other control that manage membership
that uses aspnetdb of asp.net application.
so
how i can use the userid of aspnetdb and bring it in my own database(mydb)
when the users loged in ?
thanks
|
|
|
|
|
You have a couple of options:
1. When a new user is created you can hook into the event, get the Guid and username and post that into your database then.
2. Use Membership.User.Guid (I think thats it, better double check), this returns the Guid of the current logged in user.
|
|
|
|
|
thanks for your attention.
but
there isnt any member or method like Membership.User.Guid
anyway thanks again
goodluck
|
|
|
|
|
Membership.GetUser().ProviderUserKey is what I meant. The method returns a type of System.Object but if your using SQL Server and the built in membership provider its of the type Guid.
|
|
|
|
|
Hi
I trying of use a xml file as database, i know what exist a library called openxml, but only find tutorials to sql server, exist openxml to php?.
If not exist openxml to php, how i can read a xml file with sql statements?, thanks very much for yours replys.
Greetings from Mexico
-----------------------
Cuando salga el sol, no estare aqui...
|
|
|
|
|
I must admit that I am not an expert with the openXML standard. However PHP's support of XML is fantastic (as of 5.1).
You have two choices:
The old DOM functionality (Link[^]), Which is great. The DOM classess work and are well tested.
Now PHP has recently documented the XMLReader (Linkety)[^] / XMLWriter (Linkety)[^] classes, which are the replacement for DOM. If you have any questions on them I can probably answer them or point you to the resource you need.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
PHP has COM library support and so do OpenXML Library.
Do you find some solution now?
|
|
|
|
|
Well no, What is OpenXML?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|