cancel
Showing results for 
Search instead for 
Did you mean: 

upload photo using file upload

Former Member
0 Kudos

Gudday,

I want to upload image using the file upload UI element .Iam fetching the path of the image and attached it to the source of the image .

But this is not working.....This photo upload is done as a part of ESS developement where the user browses photo,uploads it into the database and reviews it in the iview.

File upload provides browsing facility.In the upload button i should include the code to save the image in the database and in review button the image should be seen in the iview...

Can anyone sugges how to proceed further...???

Thanks,

Deepthi.

Accepted Solutions (0)

Answers (2)

Answers (2)

huseyindereli
Active Contributor
0 Kudos

Hi Thomas ,

Here, I've used the fileupload component to get the content of file just like the way you described. I've created my own ztable to store files. However i had trouble with the opposite process , converting xstring to a downloadable format and let the user have it without any corruption of file content.

Do you have any suggestions ?

Thanks.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Please be specific as to what kinds of problems you had on the download. The XSTRING that comes back out of the database is ready to download. You shouldn't have to do any manipulation to it.

huseyindereli
Active Contributor
0 Kudos

Hi Thomas,

When i was looking at the examples (WDR_TEST_EVENTS) , i thought i should do conversion by mistake. And i've figured that i should give the MIME , FILENAME and XSTRING content to the filedownload component just like the same as i got. My problem is solved after you said ; "You shouldn't have to do any manipulation to it.". Thanks for your quick answer and sorry for my misunderstanding.

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

You can store the file on the application server using C13Z_RAWDATA_READ/WRITE function modules

'SCMS_BINARY_TO_XSTRING' will be useful to convert binary to string.

Abhi

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi

>

> You can store the file on the application server using C13Z_RAWDATA_READ/WRITE function modules

> 'SCMS_BINARY_TO_XSTRING' will be useful to convert binary to string.

>

> Abhi

I would recommend against the usage of C13Z_RAWDATA_READ/WRITE. That does not appear to be a release function module for customer usage and appears to be part of the Environment Health and Safety application - and specific to the usge within that module.

Do you have a particular place where you must store this image (an HR Infostructure already) or can you create your own storage location. If the later is true, just create a custom ztable that has a field of type RAWSTRING. You can write the XSTRING variable that contains the uploaded content direclty into the RAWSTRING field using normal SQL statements. No need to perform any kind of conversion or manipulation of the data.

Former Member
0 Kudos

Gudday,

I tried for the rawstring data element or domain but i couldnt find...is der any alternate method to do this..???

Awaiting your reply.....

Thanks,

M.Martina Deepthi.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

RAWSTRING is a native data type (and has been since 6.10). You can define your own domain or data elements as RAWSTRING or just do a direct type definition within the structure or table.