I am creating OCX for Http Upload control.can anyone plz tell me why the function UploadFileHTTP returns 0 when used?I am posting my code---- -
Public Function UploadFileHTTP(ByVal localFileName As String, ByVal remoteFileName As String) As Integer
-
Dim nRet As Integer
-
Dim bRet, bQueryInfo As Boolean
-
Dim iRet As Integer
-
Dim nFileHandle, i As Integer
-
Dim bData(BUFFER_SIZE - 1) As Byte
-
Dim leftoversize As Long
-
Dim blnSendRequest As Boolean
-
Dim szContent As String
-
-
nFileHandle = FreeFile
-
-
hRequest = HttpOpenRequest(hConnect, "POST", "192.168.3.13/Fileupload/Upload_Signature.asp", "HTTP/1.0", 0, 0, INTERNET_FLAG_NO_CACHE_WRITE, 0)
-
If hRequest = 0 Then
-
LastDllErrorInfo 'Call before calling any other dll function
-
If Not HttpErrorCode = 0 Then
-
Err.Raise HttpErrorCode, , HttpErrorString
-
End If
-
Exit Function
-
End If
-
-
blnSendRequest = HttpSendRequest(hRequest, vbNullString, 0, localFileName, Len(localFileName))
-
bQueryInfo = HttpQueryInfo(hRequest, HTTP_QUERY_CONTENT_TYPE, remoteFileName, Len(remoteFileName), 0)
-
-
Close nFileHandle
-
InternetCloseHandle hRequest
-
End Function
2 1421
You're not telling the fuction to return anything.
UploadFileHTTP=bQueryInfo would make the function return the true/false value of HttpQueryInfo(*)
Since you are returning anything from the function and the function return type is integer it returns 0.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: |
last post by:
OK:
Purpose: Using user's input and 3 recursive functions, construct an hour
glass figure. Main can only have user input, loops and function calls.
Recursive function 1 takes input and displays...
|
by: Marek Lewczuk |
last post by:
Hello,
I'm moving out from MySQL to PostgreSQL and there are some function
which are not supported in PG so I'm trying to write my own functions.
Currently I have big problem with function IF(),...
|
by: Tweaxor |
last post by:
Hey,
I was trying to figure out was it possible in C to pass the values in an array
from one function to another function. Is the possible in C?
ex. y is the array that holds seven values
If...
|
by: Marco Loskamp |
last post by:
Dear list,
I'm trying to dynamically generate functions; it seems that what I
really want is beyond C itself, but I'd like to be confirmed here.
In the minimal example below, I'd like to...
|
by: Razzel |
last post by:
I created this as a test:
#include <time.h>
main(){
printf(X1: %s\n", putim());
printf(X2: %s\n", putim());
}
putim() {
time_t t;
time(&t);
return(ctime(&t));
|
by: ranjmis |
last post by:
Hi all,
I have come across a piece of code wherein a function returns a
function pointer as it seems to me but not very clear from the
prototype.
As shown below - although return type is void...
|
by: mosesdinakaran |
last post by:
Hi everybody,
Today I faced a problem where I am very confused and I could not
solve it and I am posting here....
My question is
Is is possible to return a value to a particular function
...
|
by: jknaty |
last post by:
I'm trying to create a function that splits up a column by spaces, and
I thought creating a function that finds the spaces with CHARINDEX and
then SUBSTRING on those values would an approach. I...
|
by: Antoninus Twink |
last post by:
What's the correct syntax to define a function that returns a pointer to
a function? Specifically, I'd like a function that takes an int, and
returns a pointer to a function that takes an int and...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
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$) {
}
...
|
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...
|
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
|
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...
|
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...
|
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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
| |