cancel
Showing results for 
Search instead for 
Did you mean: 

File Upload error

raja_g
Participant
0 Kudos

Hi,

In Attachment view, if no file is added and ADD button is clicked, it results in an error. The next time, if a file is added and then ADD button is clicked, even now the file is not getting added.

I checked the code and found that in the method IF_HTMLB_DATA~RESTORE_FROM_REQUEST of class CL_HTMLB_FILEUPLOAD, in line 8, num_multiparts is always returned as 0 (the first time no file was added). How can this be avoided, if a file is added and then ADD button is clicked?

Thanks & Regards

G.Raja

Accepted Solutions (1)

Accepted Solutions (1)

athavanraja
Active Contributor
0 Kudos

if <b>Attachment view</b> is your custom page, you could write a check routine to see whether the input field (for file) is blank or not .

or if its a standard application, give us the application name , may be we can have a look at it.

Regards

Raja

raja_g
Participant
0 Kudos

Hi Raja,

I've created an attachment view similar to Mail attachment view in ICWC. The following HTMLB tag is used for file upload

<htmlb:fileUpload id = "myFileUpload1"

size = "30"

/>

Is there a way to check whether the file name is filled or not?

Thanks & Regards

G.Raja

athavanraja
Active Contributor
0 Kudos

check the code given below. i am just alterting the value of the input field, you could extend the code to write logic for cancel submit when the filed is empty

<htmlb:fileUpload id          = "myUpload"
                        onUpload    = "HandleUpload"
                        upload_text = "Display"
                        size        = "90" />
                        
<script>
function test()
{
alert(document.forms[0].myUpload.value);
}
var obj = document.forms[0].myUpload ;
obj.attachEvent('onblur',test);
</script>

Regards

Raja

Answers (1)

Answers (1)

Former Member
0 Kudos

hi raja,

check this link:

/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents

hope this will help you.

if it doesnt help can you kindly send the code tyou have written on the click event of add.

regards,

Hemendra