cancel
Showing results for 
Search instead for 
Did you mean: 

htmlb:file_upload

Former Member
0 Kudos

Hi all,

I am using htmlb:fileUpload for uploading file in my BSP application.

But this is allowing me to enter any filename (just that it has to be a fully qualified name) even if that file doesnot exist in the presentation server.

e.g I am entering C:\abc.txt.This file is not existent in my server. Still uploading is done.How can I keep a check on whether this file actually exists ,before uploading ?Please suggest.

Regards,

Ananya

Accepted Solutions (1)

Accepted Solutions (1)

RenaldWittwer
Contributor
0 Kudos

Hi Ananya,

have a look in this weblog

/people/renald.wittwer/blog/2005/05/15/bsp-an-input-field-using-a-java-applet

With this Java Applet you can enter only files that exist on your local machine.

Pherhaps it helps

Best regards

Renald

eddy_declercq
Active Contributor
0 Kudos

Hi,

You can still do a check on the length:

file_length = file_content->file_length.

Eddy

Former Member
0 Kudos

Hi Eddy,

I did a check on the length.

What does this length indicate ? Length of file content ?

Or length of file name ?

Regards,

Ananya

eddy_declercq
Active Contributor
0 Kudos

Hi,

The length of the file content.

Alternatively, you can use

content = file_content->fí1e-content.

xlenfile = XSTRLEN( content ).

Eddy

Former Member
0 Kudos

Hi all,

Thanks for the responses.

Eddy, I finally settled for the length of the file content.

Renald,the blog was excellent .It was new and informative.

Regards,

Ananya

Message was edited by: Ananya Mukherjee

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Eddy,

What if,the user wants to upload an existing document which is empty ?In this case,the blank document will not get uploaded even if it is existing in the PC.Please help.

Regards,

Ananya

eddy_declercq
Active Contributor
0 Kudos

Hi,

Can you explain me the use of uploading documents of 0 bytes (if that passes anyway)?

Eddy

Former Member
0 Kudos

Hi Eddy,

There is no particular use. But the user may want to upload any document and he/she may be unaware that the document is empty.

Regards,

Ananya

Former Member
0 Kudos

Hi Raja,

I would have got back to the threads soon.But I was travelling whole of this weekend for work and right now am tied down with deadlines.However,I am sorry if I have offended you.It was not my intention.

I really appreciate and respect the responses I get from SDN.

Guillaume, Can you clarify a bit please? how to use onUnload?

Regards,

Ananya

athavanraja
Active Contributor
0 Kudos

Hi Ananya,

Thanks and hope you took my comments in the right sprit.

All the best.

Regards

Raja

athavanraja
Active Contributor
0 Kudos

Hi Ananya,

I hope you understand that this is not OSS, people here take their time and effort to help each other.

A minimum courtesy of a reply to the posts you created saying that the suggestions given by others were helpful / useless, etc is expected. (leave alone the points)

check these threads of yours

Regards

Raja

eddy_declercq
Active Contributor
0 Kudos

Hi,

Checking the file on the client side isn't feasable, unless you want to use some ActiveX, which implicates secury problems.

I would do this in the oninputprocessing.

file_content ?= cl_htmlb_manager=>get_data(

request = runtime->server->request

name = 'fileUpload'

id = 'fileUpload').

IF file_content IS NOT INITIAL.

name = file_content->file_name.

...

ENDIF.

Eddy

guillaume-hrc
Active Contributor
0 Kudos

Hi Ananya,

Did you try to implement the onUnload event in the onInputProcessing event handler ?

Best regards,

Guillaume